Hive SQL syntax is different from the frequently used MySQL syntax. SQL written according to the habit of writing MySQL often reports errors, and it is difficult to see the cause of the problem. Therefore, this paper records the phenomenon of the problem and the solution
If you don’t find any problem with the alias: select from error ‘> select from error = 4200* From a) treror: error while compiling statement: failed: semanticexception [error 10025]: expression not in group by key ID (state = 42000, code = 10025)
cause: fields in the select statement but not in the group by statement will cause the error
solution: change the select id, name from a group by name to select collect_ Set (ID), name from a group by NameError: error while compiling statement: failed: semanticexception [error 10004]: Line 1:13 invalid table alias or column reference ‘ID’:
cause: the corresponding field in the subquery statement has changed, such as using a function or renaming
solution: select id, name from (select collect)_ Set (ID), name from a group by name) t “is changed to” select id, name from (select collect)_ Set (ID) id, name from a group by name) t or select t.id, name from (select collect)_ Set (ID), name from a group by name) tproblem: unable to query data after hive multiple SQL unions
cause: the data after union is saved in HDFS to multiple new directories under the table directory
solution: add configuration (which can be directly input on the CLI command line) set mapred.input.dir .recursive=true;
Or use a select statement to package multiple union statements and then execute hsql on tez to report an error. Out of memory
needs to adjust the size of the container
set hive.tez.container .size=4096;
set hive.tez.java . opts = – xmx3072m; hive does not query subdirectories recursively by default, so when creating a table, if there are subdirectories in the specified directory, it will report ERROR:not a file
You can perform the following four configurations in hive cli to enable recursive access to subdirectories in the callback. Instead of recursive query, all the data under the directory will be loaded in. Therefore, when the subdirectories are very deep or there are many subdirectories, the speed will be very slow.
set hive.input.dir .recursive=true;
set hive.mapred.supports .subdirectories=true;
set hive.supports.subdirectories=true ;
set mapred.input.dir .recursive=true;
Read More:
- Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the
- SQL Union, union all usage and common errors and Solutions
- Error while instantiating ‘org.apache.spark.sql.hive.HiveExternalCatalog’:
- [Python] error syntax error: summary of solutions to invalid syntax
- “Hive metadata problem” hive.metastore.HiveMetaException : Failed to get schema version.
- Run spark to report error while identifying ‘ org.apache.spark . sql.hive.HiveSessionState ‘
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- About installing SQL server 0 in Windows 10 20h2 × 84bb0001 is one of the solutions
- com.alibaba.druid.sql.parser.ParserException: syntax error
- SQL Server import MDF and LDF files appear: unable to open physical file “D:\ XX.mdf “。 Operating system error 5: “5 (access denied. )”Solutions
- Solutions to error c2143: syntax error: missing ‘;’ before ‘type’ in C + + program compilation
- Execution Error SQL_ERROR_INFO: near “.“: syntax error
- SAP SQL error “SQL code: -10692“ occurred while accessing table “ZTXXXX“.
- Hive view execution plan
- The difference between hive and relational database
- This function has none of deterministic, no SQL, or reads SQL data in its error records
- SCRIPT1002: syntax error File: 0. chunk.js ,SCRIPT5009: ‘Map‘ is undefined File: 0. chunk.js -Solutions
- Spring data JAP SQL error:17059 SQL State:99999
- Spoop export hive to MySQL
- Invalid column reference when using round in hive