[ 
https://issues.apache.org/jira/browse/HIVE-22349?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16952045#comment-16952045
 ] 

Zoltan Haindrich commented on HIVE-22349:
-----------------------------------------

This issue is not present on master.


> Running sysdb initialization against mysql database results in exception 
> relating to '{LIMIT 1}'
> ------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-22349
>                 URL: https://issues.apache.org/jira/browse/HIVE-22349
>             Project: Hive
>          Issue Type: Bug
>    Affects Versions: 3.1.2
>            Reporter: Zoltan Haindrich
>            Priority: Major
>
> Running it against 3.1.2 results in:
> {code}
> ERROR : FAILED: Execution Error, return code 1 from 
> org.apache.hadoop.hive.ql.exec.DDLTask. java.lang.RuntimeException: 
> MetaException(message:org.apache.hadoop.hive.serde2.SerDeException 
> org.apache.hive.storage.jdbc.exception.HiveJdbcDatabaseAccessException: Error 
> while trying to get column names: You have an error in your SQL syntax; check 
> the manual that corresponds to your MariaDB server version for the right 
> syntax to use near '{LIMIT 1}' at line 1)
> DEBUG : Shutting down query CREATE EXTERNAL TABLE IF NOT EXISTS 
> `BUCKETING_COLS` ( `SD_ID` bigint, `BUCKET_COL_NAME` string, `INTEGER_IDX` 
> int, CONSTRAINT `SYS_PK_BUCKETING_COLS` PRIMARY KEY (`SD_ID`,`INTEGER_IDX`) 
> DISABLE ) STORED BY 'org.apache.hive.storage.jdbc.JdbcStorageHandler' 
> TBLPROPERTIES ( "hive.sql.database.type" = "METASTORE", "hive.sql.query" = 
> "SELECT `SD_ID`, `BUCKET_COL_NAME`, `INTEGER_IDX` FROM `BUCKETING_COLS`" )
> INFO  : Completed executing 
> command(queryId=dev_20191015154644_c16d4f1f-e0cf-44ee-86ee-c9fa76b4dfce); 
> Time taken: 0.246 seconds
> INFO  : Concurrency mode is disabled, not creating a lock manager
> DEBUG : Shutting down query CREATE EXTERNAL TABLE IF NOT EXISTS 
> `BUCKETING_COLS` ( `SD_ID` bigint, `BUCKET_COL_NAME` string, `INTEGER_IDX` 
> int, CONSTRAINT `SYS_PK_BUCKETING_COLS` PRIMARY KEY (`SD_ID`,`INTEGER_IDX`) 
> DISABLE ) STORED BY 'org.apache.hive.storage.jdbc.JdbcStorageHandler' 
> TBLPROPERTIES ( "hive.sql.database.type" = "METASTORE", "hive.sql.query" = 
> "SELECT `SD_ID`, `BUCKET_COL_NAME`, `INTEGER_IDX` FROM `BUCKETING_COLS`" )
> 2019-10-15 15:46:45,211 f2e4e01c-4026-4b44-98cc-17192ddbcfe8 main DEBUG 
> Deleting route with dev_20191015154644_c16d4f1f-e0cf-44ee-86ee-c9fa76b4dfce 
> key 
> 2019-10-15 15:46:45,211 f2e4e01c-4026-4b44-98cc-17192ddbcfe8 main DEBUG 
> Stopping route with dev_20191015154644_c16d4f1f-e0cf-44ee-86ee-c9fa76b4dfce 
> key
> 2019-10-15 15:46:45,212 f2e4e01c-4026-4b44-98cc-17192ddbcfe8 main DEBUG 
> Shutting down RandomAccessFileManager 
> /tmp/dev/operation_logs/f2e4e01c-4026-4b44-98cc-17192ddbcfe8/dev_20191015154644_c16d4f1f-e0cf-44ee-86ee-c9fa76b4dfce
> 2019-10-15 15:46:45,212 f2e4e01c-4026-4b44-98cc-17192ddbcfe8 main DEBUG Shut 
> down RandomAccessFileManager 
> /tmp/dev/operation_logs/f2e4e01c-4026-4b44-98cc-17192ddbcfe8/dev_20191015154644_c16d4f1f-e0cf-44ee-86ee-c9fa76b4dfce,
>  all resources released: true
> 2019-10-15 15:46:45,212 f2e4e01c-4026-4b44-98cc-17192ddbcfe8 main DEBUG 
> Appender query-file-appender stopped with status true
> 2019-10-15 15:46:45,212 f2e4e01c-4026-4b44-98cc-17192ddbcfe8 main DEBUG 
> Deleting route with dev_20191015154644_c16d4f1f-e0cf-44ee-86ee-c9fa76b4dfce 
> key 
> 2019-10-15 15:46:45,212 f2e4e01c-4026-4b44-98cc-17192ddbcfe8 main DEBUG 
> Stopping route with dev_20191015154644_c16d4f1f-e0cf-44ee-86ee-c9fa76b4dfce 
> key
> 2019-10-15 15:46:45,212 f2e4e01c-4026-4b44-98cc-17192ddbcfe8 main DEBUG 
> Shutting down RandomAccessFileManager 
> /tmp/dev/operation_logs/f2e4e01c-4026-4b44-98cc-17192ddbcfe8/dev_20191015154644_c16d4f1f-e0cf-44ee-86ee-c9fa76b4dfce.test
> 2019-10-15 15:46:45,212 f2e4e01c-4026-4b44-98cc-17192ddbcfe8 main DEBUG Shut 
> down RandomAccessFileManager 
> /tmp/dev/operation_logs/f2e4e01c-4026-4b44-98cc-17192ddbcfe8/dev_20191015154644_c16d4f1f-e0cf-44ee-86ee-c9fa76b4dfce.test,
>  all resources released: true
> 2019-10-15 15:46:45,212 f2e4e01c-4026-4b44-98cc-17192ddbcfe8 main DEBUG 
> Appender test-query-file-appender stopped with status true
> 2019-10-15 15:46:45,213 f2e4e01c-4026-4b44-98cc-17192ddbcfe8 main DEBUG 
> Building Plugin[name=filter, 
> class=org.apache.hadoop.hive.ql.log.LogDivertAppender$NameFilter].
> 2019-10-15 15:46:45,213 f2e4e01c-4026-4b44-98cc-17192ddbcfe8 main DEBUG 
> createFilter(loggingLevel="EXECUTION")
> 2019-10-15 15:46:45,213 f2e4e01c-4026-4b44-98cc-17192ddbcfe8 main DEBUG 
> Building Plugin[name=layout, 
> class=org.apache.logging.log4j.core.layout.PatternLayout].
> 2019-10-15 15:46:45,213 f2e4e01c-4026-4b44-98cc-17192ddbcfe8 main DEBUG 
> PatternLayout$Builder(pattern="%-5p : %m%n", PatternSelector=null, 
> Configuration(HiveLog4j2), Replace=null, charset="null", 
> alwaysWriteExceptions="null", disableAnsi="null", noConsoleNoAnsi="null", 
> header="null", footer="null")
> 2019-10-15 15:46:45,214 f2e4e01c-4026-4b44-98cc-17192ddbcfe8 main DEBUG 
> Building Plugin[name=appender, 
> class=org.apache.hadoop.hive.ql.log.HushableRandomAccessFileAppender].
> 2019-10-15 15:46:45,214 f2e4e01c-4026-4b44-98cc-17192ddbcfe8 main DEBUG 
> createAppender(fileName="/tmp/dev/operation_logs/f2e4e01c-4026-4b44-98cc-17192ddbcfe8/dev_20191015154644_c16d4f1f-e0cf-44ee-86ee-c9fa76b4dfce",
>  append="null", name="query-file-appender", immediateFlush="null", 
> bufferSize="null", ignoreExceptions="null", 
> PatternLayout(org.apache.logging.log4j.core.layout.PatternLayout with name 
> PatternLayout), 
> NameFilter(org.apache.hadoop.hive.ql.log.LogDivertAppender$NameFilter with 
> name NameFilter), advertise="null", advertiseURI="null", 
> Configuration(HiveLog4j2))
> 2019-10-15 15:46:45,214 f2e4e01c-4026-4b44-98cc-17192ddbcfe8 main DEBUG 
> Starting RandomAccessFileManager 
> /tmp/dev/operation_logs/f2e4e01c-4026-4b44-98cc-17192ddbcfe8/dev_20191015154644_c16d4f1f-e0cf-44ee-86ee-c9fa76b4dfce
> 2019-10-15 15:46:45,214 f2e4e01c-4026-4b44-98cc-17192ddbcfe8 main DEBUG 
> Building Plugin[name=, 
> class=org.apache.hadoop.hive.ql.log.LogDivertAppenderForTest$TestFilter].
> 2019-10-15 15:46:45,215 f2e4e01c-4026-4b44-98cc-17192ddbcfe8 main DEBUG 
> createFilter()
> 2019-10-15 15:46:45,215 f2e4e01c-4026-4b44-98cc-17192ddbcfe8 main DEBUG 
> Building Plugin[name=, 
> class=org.apache.logging.log4j.core.layout.PatternLayout].
> 2019-10-15 15:46:45,215 f2e4e01c-4026-4b44-98cc-17192ddbcfe8 main DEBUG 
> PatternLayout$Builder(pattern="%-5p : %m%n", PatternSelector=null, 
> Configuration(HiveLog4j2), Replace=null, charset="null", 
> alwaysWriteExceptions="null", disableAnsi="null", noConsoleNoAnsi="null", 
> header="null", footer="null")
> 2019-10-15 15:46:45,215 f2e4e01c-4026-4b44-98cc-17192ddbcfe8 main DEBUG 
> Building Plugin[name=appender, 
> class=org.apache.hadoop.hive.ql.log.HushableRandomAccessFileAppender].
> 2019-10-15 15:46:45,215 f2e4e01c-4026-4b44-98cc-17192ddbcfe8 main DEBUG 
> createAppender(fileName="/tmp/dev/operation_logs/f2e4e01c-4026-4b44-98cc-17192ddbcfe8/dev_20191015154644_c16d4f1f-e0cf-44ee-86ee-c9fa76b4dfce.test",
>  append="null", name="test-query-file-appender", immediateFlush="null", 
> bufferSize="null", ignoreExceptions="null", 
> PatternLayout(org.apache.logging.log4j.core.layout.PatternLayout with name 
> PatternLayout), 
> test-filter(org.apache.hadoop.hive.ql.log.LogDivertAppenderForTest$TestFilter 
> with name test-filter), advertise="null", advertiseURI="null", 
> Configuration(HiveLog4j2))
> 2019-10-15 15:46:45,216 f2e4e01c-4026-4b44-98cc-17192ddbcfe8 main DEBUG 
> Starting RandomAccessFileManager 
> /tmp/dev/operation_logs/f2e4e01c-4026-4b44-98cc-17192ddbcfe8/dev_20191015154644_c16d4f1f-e0cf-44ee-86ee-c9fa76b4dfce.test
> Error: Error while processing statement: FAILED: Execution Error, return code 
> 1 from org.apache.hadoop.hive.ql.exec.DDLTask. java.lang.RuntimeException: 
> MetaException(message:org.apache.hadoop.hive.serde2.SerDeException 
> org.apache.hive.storage.jdbc.exception.HiveJdbcDatabaseAccessException: Error 
> while trying to get column names: You have an error in your SQL syntax; check 
> the manual that corresponds to your MariaDB server version for the right 
> syntax to use near '{LIMIT 1}' at line 1) (state=08S01,code=1)
> Closing: 0: 
> jdbc:hive2://?hive.conf.restricted.list=;hive.security.authorization.sqlstd.confwhitelist=.*;hive.security.authorization.sqlstd.confwhitelist.append=.*;hive.security.authorization.enabled=false;hive.metastore.uris=;hive.security.authorization.manager=org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdConfOnlyAuthorizerFactory;hive.support.concurrency=false;hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DummyTxnManager;hive.metastore.rawstore.impl=org.apache.hadoop.hive.metastore.ObjectStore
> org.apache.hadoop.hive.metastore.HiveMetaException: Schema initialization 
> FAILED! Metastore state would be inconsistent !!
> Underlying cause: java.io.IOException : Schema script failed, errorcode 2
> org.apache.hadoop.hive.metastore.HiveMetaException: Schema initialization 
> FAILED! Metastore state would be inconsistent !!
>       at 
> org.apache.hive.beeline.HiveSchemaTool.doInit(HiveSchemaTool.java:594)
>       at 
> org.apache.hive.beeline.HiveSchemaTool.doInit(HiveSchemaTool.java:567)
>       at org.apache.hive.beeline.HiveSchemaTool.main(HiveSchemaTool.java:1517)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>       at java.lang.reflect.Method.invoke(Method.java:498)
>       at org.apache.hadoop.util.RunJar.run(RunJar.java:318)
>       at org.apache.hadoop.util.RunJar.main(RunJar.java:232)
> Caused by: java.io.IOException: Schema script failed, errorcode 2
>       at 
> org.apache.hive.beeline.HiveSchemaTool.runBeeLine(HiveSchemaTool.java:1226)
>       at 
> org.apache.hive.beeline.HiveSchemaTool.runBeeLine(HiveSchemaTool.java:1204)
>       at 
> org.apache.hive.beeline.HiveSchemaTool.doInit(HiveSchemaTool.java:590)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to