[jira] [Updated] (DRILL-6923) Show schemas uses default(user defined) schema first for resolving table from information_schema
[ https://issues.apache.org/jira/browse/DRILL-6923?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Arina Ielchiieva updated DRILL-6923: Fix Version/s: (was: 1.17.0) > Show schemas uses default(user defined) schema first for resolving table from > information_schema > > > Key: DRILL-6923 > URL: https://issues.apache.org/jira/browse/DRILL-6923 > Project: Apache Drill > Issue Type: Bug > Components: Storage - Hive >Affects Versions: 1.14.0 >Reporter: Igor Guzenko >Assignee: Igor Guzenko >Priority: Minor > > Show tables tries to find table `information_schema`.`schemata` in default > (user defined) schema, and after failed attempt it resolves table > successfully against root schema. Please check description below for details > explained using example with hive plugin. > *Abstract* > When Drill used with enabled Hive SQL Standard authorization, execution of > queries like, > {code:sql} > USE hive.db_general; > SHOW SCHEMAS LIKE 'hive.%'; {code} > results in error DrillRuntimeException: Failed to use the Hive authorization > components: Error getting object from metastore for Object > [type=TABLE_OR_VIEW, name=db_general.information_schema] . > *Details* > Consider showSchemas() test similar to one defined in > TestSqlStdBasedAuthorization : > {code:java} > @Test > public void showSchemas() throws Exception { > test("USE " + hivePluginName + "." + db_general); > testBuilder() > .sqlQuery("SHOW SCHEMAS LIKE 'hive.%'") > .unOrdered() > .baselineColumns("SCHEMA_NAME") > .baselineValues("hive.db_general") > .baselineValues("hive.default") > .go(); > } > {code} > Currently execution of such test will produce following stacktrace: > {code:none} > Caused by: org.apache.drill.common.exceptions.DrillRuntimeException: Failed > to use the Hive authorization components: Error getting object from metastore > for Object [type=TABLE_OR_VIEW, name=db_general.information_schema] > at > org.apache.drill.exec.store.hive.HiveAuthorizationHelper.authorize(HiveAuthorizationHelper.java:149) > at > org.apache.drill.exec.store.hive.HiveAuthorizationHelper.authorizeReadTable(HiveAuthorizationHelper.java:134) > at > org.apache.drill.exec.store.hive.DrillHiveMetaStoreClient$HiveClientWithAuthzWithCaching.getHiveReadEntry(DrillHiveMetaStoreClient.java:450) > at > org.apache.drill.exec.store.hive.schema.HiveSchemaFactory$HiveSchema.getSelectionBaseOnName(HiveSchemaFactory.java:233) > at > org.apache.drill.exec.store.hive.schema.HiveSchemaFactory$HiveSchema.getDrillTable(HiveSchemaFactory.java:214) > at > org.apache.drill.exec.store.hive.schema.HiveDatabaseSchema.getTable(HiveDatabaseSchema.java:63) > at > org.apache.calcite.jdbc.SimpleCalciteSchema.getImplicitTable(SimpleCalciteSchema.java:83) > at org.apache.calcite.jdbc.CalciteSchema.getTable(CalciteSchema.java:288) > at org.apache.calcite.sql.validate.EmptyScope.resolve_(EmptyScope.java:143) > at org.apache.calcite.sql.validate.EmptyScope.resolveTable(EmptyScope.java:99) > at > org.apache.calcite.sql.validate.DelegatingScope.resolveTable(DelegatingScope.java:203) > at > org.apache.calcite.sql.validate.IdentifierNamespace.resolveImpl(IdentifierNamespace.java:105) > at > org.apache.calcite.sql.validate.IdentifierNamespace.validateImpl(IdentifierNamespace.java:177) > at > org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:967) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:943) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:3032) > at > org.apache.drill.exec.planner.sql.SqlConverter$DrillValidator.validateFrom(SqlConverter.java:274) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:3014) > at > org.apache.drill.exec.planner.sql.SqlConverter$DrillValidator.validateFrom(SqlConverter.java:274) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelect(SqlValidatorImpl.java:3284) > at > org.apache.calcite.sql.validate.SelectNamespace.validateImpl(SelectNamespace.java:60) > at > org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:967) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:943) > at org.apache.calcite.sql.SqlSelect.validate(SqlSelect.java:225) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateScopedExpression(SqlValidatorImpl.java:918) > at > org.apache.calcite.sql.validate.SqlValidator
[jira] [Updated] (DRILL-6923) Show schemas uses default(user defined) schema first for resolving table from information_schema
[ https://issues.apache.org/jira/browse/DRILL-6923?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Igor Guzenko updated DRILL-6923: Fix Version/s: (was: 1.16.0) 1.17.0 > Show schemas uses default(user defined) schema first for resolving table from > information_schema > > > Key: DRILL-6923 > URL: https://issues.apache.org/jira/browse/DRILL-6923 > Project: Apache Drill > Issue Type: Bug > Components: Storage - Hive >Affects Versions: 1.14.0 >Reporter: Igor Guzenko >Assignee: Igor Guzenko >Priority: Minor > Fix For: 1.17.0 > > > Show tables tries to find table `information_schema`.`schemata` in default > (user defined) schema, and after failed attempt it resolves table > successfully against root schema. Please check description below for details > explained using example with hive plugin. > *Abstract* > When Drill used with enabled Hive SQL Standard authorization, execution of > queries like, > {code:sql} > USE hive.db_general; > SHOW SCHEMAS LIKE 'hive.%'; {code} > results in error DrillRuntimeException: Failed to use the Hive authorization > components: Error getting object from metastore for Object > [type=TABLE_OR_VIEW, name=db_general.information_schema] . > *Details* > Consider showSchemas() test similar to one defined in > TestSqlStdBasedAuthorization : > {code:java} > @Test > public void showSchemas() throws Exception { > test("USE " + hivePluginName + "." + db_general); > testBuilder() > .sqlQuery("SHOW SCHEMAS LIKE 'hive.%'") > .unOrdered() > .baselineColumns("SCHEMA_NAME") > .baselineValues("hive.db_general") > .baselineValues("hive.default") > .go(); > } > {code} > Currently execution of such test will produce following stacktrace: > {code:none} > Caused by: org.apache.drill.common.exceptions.DrillRuntimeException: Failed > to use the Hive authorization components: Error getting object from metastore > for Object [type=TABLE_OR_VIEW, name=db_general.information_schema] > at > org.apache.drill.exec.store.hive.HiveAuthorizationHelper.authorize(HiveAuthorizationHelper.java:149) > at > org.apache.drill.exec.store.hive.HiveAuthorizationHelper.authorizeReadTable(HiveAuthorizationHelper.java:134) > at > org.apache.drill.exec.store.hive.DrillHiveMetaStoreClient$HiveClientWithAuthzWithCaching.getHiveReadEntry(DrillHiveMetaStoreClient.java:450) > at > org.apache.drill.exec.store.hive.schema.HiveSchemaFactory$HiveSchema.getSelectionBaseOnName(HiveSchemaFactory.java:233) > at > org.apache.drill.exec.store.hive.schema.HiveSchemaFactory$HiveSchema.getDrillTable(HiveSchemaFactory.java:214) > at > org.apache.drill.exec.store.hive.schema.HiveDatabaseSchema.getTable(HiveDatabaseSchema.java:63) > at > org.apache.calcite.jdbc.SimpleCalciteSchema.getImplicitTable(SimpleCalciteSchema.java:83) > at org.apache.calcite.jdbc.CalciteSchema.getTable(CalciteSchema.java:288) > at org.apache.calcite.sql.validate.EmptyScope.resolve_(EmptyScope.java:143) > at org.apache.calcite.sql.validate.EmptyScope.resolveTable(EmptyScope.java:99) > at > org.apache.calcite.sql.validate.DelegatingScope.resolveTable(DelegatingScope.java:203) > at > org.apache.calcite.sql.validate.IdentifierNamespace.resolveImpl(IdentifierNamespace.java:105) > at > org.apache.calcite.sql.validate.IdentifierNamespace.validateImpl(IdentifierNamespace.java:177) > at > org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:967) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:943) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:3032) > at > org.apache.drill.exec.planner.sql.SqlConverter$DrillValidator.validateFrom(SqlConverter.java:274) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:3014) > at > org.apache.drill.exec.planner.sql.SqlConverter$DrillValidator.validateFrom(SqlConverter.java:274) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelect(SqlValidatorImpl.java:3284) > at > org.apache.calcite.sql.validate.SelectNamespace.validateImpl(SelectNamespace.java:60) > at > org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:967) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:943) > at org.apache.calcite.sql.SqlSelect.validate(SqlSelect.java:225) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateScopedExpression(SqlValidatorImpl.java:918) >
[jira] [Updated] (DRILL-6923) Show schemas uses default(user defined) schema first for resolving table from information_schema
[ https://issues.apache.org/jira/browse/DRILL-6923?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Igor Guzenko updated DRILL-6923: Priority: Minor (was: Major) > Show schemas uses default(user defined) schema first for resolving table from > information_schema > > > Key: DRILL-6923 > URL: https://issues.apache.org/jira/browse/DRILL-6923 > Project: Apache Drill > Issue Type: Bug > Components: Storage - Hive >Affects Versions: 1.14.0 >Reporter: Igor Guzenko >Assignee: Igor Guzenko >Priority: Minor > Fix For: 1.16.0 > > > Show tables tries to find table `information_schema`.`schemata` in default > (user defined) schema, and after failed attempt it resolves table > successfully against root schema. Please check description below for details > explained using example with hive plugin. > *Abstract* > When Drill used with enabled Hive SQL Standard authorization, execution of > queries like, > {code:sql} > USE hive.db_general; > SHOW SCHEMAS LIKE 'hive.%'; {code} > results in error DrillRuntimeException: Failed to use the Hive authorization > components: Error getting object from metastore for Object > [type=TABLE_OR_VIEW, name=db_general.information_schema] . > *Details* > Consider showSchemas() test similar to one defined in > TestSqlStdBasedAuthorization : > {code:java} > @Test > public void showSchemas() throws Exception { > test("USE " + hivePluginName + "." + db_general); > testBuilder() > .sqlQuery("SHOW SCHEMAS LIKE 'hive.%'") > .unOrdered() > .baselineColumns("SCHEMA_NAME") > .baselineValues("hive.db_general") > .baselineValues("hive.default") > .go(); > } > {code} > Currently execution of such test will produce following stacktrace: > {code:none} > Caused by: org.apache.drill.common.exceptions.DrillRuntimeException: Failed > to use the Hive authorization components: Error getting object from metastore > for Object [type=TABLE_OR_VIEW, name=db_general.information_schema] > at > org.apache.drill.exec.store.hive.HiveAuthorizationHelper.authorize(HiveAuthorizationHelper.java:149) > at > org.apache.drill.exec.store.hive.HiveAuthorizationHelper.authorizeReadTable(HiveAuthorizationHelper.java:134) > at > org.apache.drill.exec.store.hive.DrillHiveMetaStoreClient$HiveClientWithAuthzWithCaching.getHiveReadEntry(DrillHiveMetaStoreClient.java:450) > at > org.apache.drill.exec.store.hive.schema.HiveSchemaFactory$HiveSchema.getSelectionBaseOnName(HiveSchemaFactory.java:233) > at > org.apache.drill.exec.store.hive.schema.HiveSchemaFactory$HiveSchema.getDrillTable(HiveSchemaFactory.java:214) > at > org.apache.drill.exec.store.hive.schema.HiveDatabaseSchema.getTable(HiveDatabaseSchema.java:63) > at > org.apache.calcite.jdbc.SimpleCalciteSchema.getImplicitTable(SimpleCalciteSchema.java:83) > at org.apache.calcite.jdbc.CalciteSchema.getTable(CalciteSchema.java:288) > at org.apache.calcite.sql.validate.EmptyScope.resolve_(EmptyScope.java:143) > at org.apache.calcite.sql.validate.EmptyScope.resolveTable(EmptyScope.java:99) > at > org.apache.calcite.sql.validate.DelegatingScope.resolveTable(DelegatingScope.java:203) > at > org.apache.calcite.sql.validate.IdentifierNamespace.resolveImpl(IdentifierNamespace.java:105) > at > org.apache.calcite.sql.validate.IdentifierNamespace.validateImpl(IdentifierNamespace.java:177) > at > org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:967) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:943) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:3032) > at > org.apache.drill.exec.planner.sql.SqlConverter$DrillValidator.validateFrom(SqlConverter.java:274) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:3014) > at > org.apache.drill.exec.planner.sql.SqlConverter$DrillValidator.validateFrom(SqlConverter.java:274) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelect(SqlValidatorImpl.java:3284) > at > org.apache.calcite.sql.validate.SelectNamespace.validateImpl(SelectNamespace.java:60) > at > org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:967) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:943) > at org.apache.calcite.sql.SqlSelect.validate(SqlSelect.java:225) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateScopedExpression(SqlValidatorImpl.java:918) > at > org.apache.calcite.sql.
[jira] [Updated] (DRILL-6923) Show schemas uses default(user defined) schema first for resolving table from information_schema
[ https://issues.apache.org/jira/browse/DRILL-6923?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Arina Ielchiieva updated DRILL-6923: Fix Version/s: 1.16.0 > Show schemas uses default(user defined) schema first for resolving table from > information_schema > > > Key: DRILL-6923 > URL: https://issues.apache.org/jira/browse/DRILL-6923 > Project: Apache Drill > Issue Type: Bug > Components: Storage - Hive >Affects Versions: 1.14.0 >Reporter: Igor Guzenko >Assignee: Igor Guzenko >Priority: Major > Fix For: 1.16.0 > > > Show tables tries to find table `information_schema`.`schemata` in default > (user defined) schema, and after failed attempt it resolves table > successfully against root schema. Please check description below for details > explained using example with hive plugin. > *Abstract* > When Drill used with enabled Hive SQL Standard authorization, execution of > queries like, > {code:sql} > USE hive.db_general; > SHOW SCHEMAS LIKE 'hive.%'; {code} > results in error DrillRuntimeException: Failed to use the Hive authorization > components: Error getting object from metastore for Object > [type=TABLE_OR_VIEW, name=db_general.information_schema] . > *Details* > Consider showSchemas() test similar to one defined in > TestSqlStdBasedAuthorization : > {code:java} > @Test > public void showSchemas() throws Exception { > test("USE " + hivePluginName + "." + db_general); > testBuilder() > .sqlQuery("SHOW SCHEMAS LIKE 'hive.%'") > .unOrdered() > .baselineColumns("SCHEMA_NAME") > .baselineValues("hive.db_general") > .baselineValues("hive.default") > .go(); > } > {code} > Currently execution of such test will produce following stacktrace: > {code:none} > Caused by: org.apache.drill.common.exceptions.DrillRuntimeException: Failed > to use the Hive authorization components: Error getting object from metastore > for Object [type=TABLE_OR_VIEW, name=db_general.information_schema] > at > org.apache.drill.exec.store.hive.HiveAuthorizationHelper.authorize(HiveAuthorizationHelper.java:149) > at > org.apache.drill.exec.store.hive.HiveAuthorizationHelper.authorizeReadTable(HiveAuthorizationHelper.java:134) > at > org.apache.drill.exec.store.hive.DrillHiveMetaStoreClient$HiveClientWithAuthzWithCaching.getHiveReadEntry(DrillHiveMetaStoreClient.java:450) > at > org.apache.drill.exec.store.hive.schema.HiveSchemaFactory$HiveSchema.getSelectionBaseOnName(HiveSchemaFactory.java:233) > at > org.apache.drill.exec.store.hive.schema.HiveSchemaFactory$HiveSchema.getDrillTable(HiveSchemaFactory.java:214) > at > org.apache.drill.exec.store.hive.schema.HiveDatabaseSchema.getTable(HiveDatabaseSchema.java:63) > at > org.apache.calcite.jdbc.SimpleCalciteSchema.getImplicitTable(SimpleCalciteSchema.java:83) > at org.apache.calcite.jdbc.CalciteSchema.getTable(CalciteSchema.java:288) > at org.apache.calcite.sql.validate.EmptyScope.resolve_(EmptyScope.java:143) > at org.apache.calcite.sql.validate.EmptyScope.resolveTable(EmptyScope.java:99) > at > org.apache.calcite.sql.validate.DelegatingScope.resolveTable(DelegatingScope.java:203) > at > org.apache.calcite.sql.validate.IdentifierNamespace.resolveImpl(IdentifierNamespace.java:105) > at > org.apache.calcite.sql.validate.IdentifierNamespace.validateImpl(IdentifierNamespace.java:177) > at > org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:967) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:943) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:3032) > at > org.apache.drill.exec.planner.sql.SqlConverter$DrillValidator.validateFrom(SqlConverter.java:274) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:3014) > at > org.apache.drill.exec.planner.sql.SqlConverter$DrillValidator.validateFrom(SqlConverter.java:274) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelect(SqlValidatorImpl.java:3284) > at > org.apache.calcite.sql.validate.SelectNamespace.validateImpl(SelectNamespace.java:60) > at > org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:967) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:943) > at org.apache.calcite.sql.SqlSelect.validate(SqlSelect.java:225) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateScopedExpression(SqlValidatorImpl.java:918) > at > org.apache.calcite.sql.
[jira] [Updated] (DRILL-6923) Show schemas uses default(user defined) schema first for resolving table from information_schema
[ https://issues.apache.org/jira/browse/DRILL-6923?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Arina Ielchiieva updated DRILL-6923: Affects Version/s: 1.14.0 > Show schemas uses default(user defined) schema first for resolving table from > information_schema > > > Key: DRILL-6923 > URL: https://issues.apache.org/jira/browse/DRILL-6923 > Project: Apache Drill > Issue Type: Bug > Components: Storage - Hive >Affects Versions: 1.14.0 >Reporter: Igor Guzenko >Assignee: Igor Guzenko >Priority: Major > > Show tables tries to find table `information_schema`.`schemata` in default > (user defined) schema, and after failed attempt it resolves table > successfully against root schema. Please check description below for details > explained using example with hive plugin. > *Abstract* > When Drill used with enabled Hive SQL Standard authorization, execution of > queries like, > {code:sql} > USE hive.db_general; > SHOW SCHEMAS LIKE 'hive.%'; {code} > results in error DrillRuntimeException: Failed to use the Hive authorization > components: Error getting object from metastore for Object > [type=TABLE_OR_VIEW, name=db_general.information_schema] . > *Details* > Consider showSchemas() test similar to one defined in > TestSqlStdBasedAuthorization : > {code:java} > @Test > public void showSchemas() throws Exception { > test("USE " + hivePluginName + "." + db_general); > testBuilder() > .sqlQuery("SHOW SCHEMAS LIKE 'hive.%'") > .unOrdered() > .baselineColumns("SCHEMA_NAME") > .baselineValues("hive.db_general") > .baselineValues("hive.default") > .go(); > } > {code} > Currently execution of such test will produce following stacktrace: > {code:none} > Caused by: org.apache.drill.common.exceptions.DrillRuntimeException: Failed > to use the Hive authorization components: Error getting object from metastore > for Object [type=TABLE_OR_VIEW, name=db_general.information_schema] > at > org.apache.drill.exec.store.hive.HiveAuthorizationHelper.authorize(HiveAuthorizationHelper.java:149) > at > org.apache.drill.exec.store.hive.HiveAuthorizationHelper.authorizeReadTable(HiveAuthorizationHelper.java:134) > at > org.apache.drill.exec.store.hive.DrillHiveMetaStoreClient$HiveClientWithAuthzWithCaching.getHiveReadEntry(DrillHiveMetaStoreClient.java:450) > at > org.apache.drill.exec.store.hive.schema.HiveSchemaFactory$HiveSchema.getSelectionBaseOnName(HiveSchemaFactory.java:233) > at > org.apache.drill.exec.store.hive.schema.HiveSchemaFactory$HiveSchema.getDrillTable(HiveSchemaFactory.java:214) > at > org.apache.drill.exec.store.hive.schema.HiveDatabaseSchema.getTable(HiveDatabaseSchema.java:63) > at > org.apache.calcite.jdbc.SimpleCalciteSchema.getImplicitTable(SimpleCalciteSchema.java:83) > at org.apache.calcite.jdbc.CalciteSchema.getTable(CalciteSchema.java:288) > at org.apache.calcite.sql.validate.EmptyScope.resolve_(EmptyScope.java:143) > at org.apache.calcite.sql.validate.EmptyScope.resolveTable(EmptyScope.java:99) > at > org.apache.calcite.sql.validate.DelegatingScope.resolveTable(DelegatingScope.java:203) > at > org.apache.calcite.sql.validate.IdentifierNamespace.resolveImpl(IdentifierNamespace.java:105) > at > org.apache.calcite.sql.validate.IdentifierNamespace.validateImpl(IdentifierNamespace.java:177) > at > org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:967) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:943) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:3032) > at > org.apache.drill.exec.planner.sql.SqlConverter$DrillValidator.validateFrom(SqlConverter.java:274) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:3014) > at > org.apache.drill.exec.planner.sql.SqlConverter$DrillValidator.validateFrom(SqlConverter.java:274) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelect(SqlValidatorImpl.java:3284) > at > org.apache.calcite.sql.validate.SelectNamespace.validateImpl(SelectNamespace.java:60) > at > org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:967) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:943) > at org.apache.calcite.sql.SqlSelect.validate(SqlSelect.java:225) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateScopedExpression(SqlValidatorImpl.java:918) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.va
[jira] [Updated] (DRILL-6923) Show schemas uses default(user defined) schema first for resolving table from information_schema
[ https://issues.apache.org/jira/browse/DRILL-6923?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Igor Guzenko updated DRILL-6923: Description: Show tables tries to find table `information_schema`.`schemata` in default (user defined) schema, and after failed attempt it resolves table successfully against root schema. Please check description below for details explained using example with hive plugin. *Abstract* When Drill used with enabled Hive SQL Standard authorization, execution of queries like, {code:sql} USE hive.db_general; SHOW SCHEMAS LIKE 'hive.%'; {code} results in error DrillRuntimeException: Failed to use the Hive authorization components: Error getting object from metastore for Object [type=TABLE_OR_VIEW, name=db_general.information_schema] . *Details* Consider showSchemas() test similar to one defined in TestSqlStdBasedAuthorization : {code:java} @Test public void showSchemas() throws Exception { test("USE " + hivePluginName + "." + db_general); testBuilder() .sqlQuery("SHOW SCHEMAS LIKE 'hive.%'") .unOrdered() .baselineColumns("SCHEMA_NAME") .baselineValues("hive.db_general") .baselineValues("hive.default") .go(); } {code} Currently execution of such test will produce following stacktrace: {code:none} Caused by: org.apache.drill.common.exceptions.DrillRuntimeException: Failed to use the Hive authorization components: Error getting object from metastore for Object [type=TABLE_OR_VIEW, name=db_general.information_schema] at org.apache.drill.exec.store.hive.HiveAuthorizationHelper.authorize(HiveAuthorizationHelper.java:149) at org.apache.drill.exec.store.hive.HiveAuthorizationHelper.authorizeReadTable(HiveAuthorizationHelper.java:134) at org.apache.drill.exec.store.hive.DrillHiveMetaStoreClient$HiveClientWithAuthzWithCaching.getHiveReadEntry(DrillHiveMetaStoreClient.java:450) at org.apache.drill.exec.store.hive.schema.HiveSchemaFactory$HiveSchema.getSelectionBaseOnName(HiveSchemaFactory.java:233) at org.apache.drill.exec.store.hive.schema.HiveSchemaFactory$HiveSchema.getDrillTable(HiveSchemaFactory.java:214) at org.apache.drill.exec.store.hive.schema.HiveDatabaseSchema.getTable(HiveDatabaseSchema.java:63) at org.apache.calcite.jdbc.SimpleCalciteSchema.getImplicitTable(SimpleCalciteSchema.java:83) at org.apache.calcite.jdbc.CalciteSchema.getTable(CalciteSchema.java:288) at org.apache.calcite.sql.validate.EmptyScope.resolve_(EmptyScope.java:143) at org.apache.calcite.sql.validate.EmptyScope.resolveTable(EmptyScope.java:99) at org.apache.calcite.sql.validate.DelegatingScope.resolveTable(DelegatingScope.java:203) at org.apache.calcite.sql.validate.IdentifierNamespace.resolveImpl(IdentifierNamespace.java:105) at org.apache.calcite.sql.validate.IdentifierNamespace.validateImpl(IdentifierNamespace.java:177) at org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84) at org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:967) at org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:943) at org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:3032) at org.apache.drill.exec.planner.sql.SqlConverter$DrillValidator.validateFrom(SqlConverter.java:274) at org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:3014) at org.apache.drill.exec.planner.sql.SqlConverter$DrillValidator.validateFrom(SqlConverter.java:274) at org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelect(SqlValidatorImpl.java:3284) at org.apache.calcite.sql.validate.SelectNamespace.validateImpl(SelectNamespace.java:60) at org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84) at org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:967) at org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:943) at org.apache.calcite.sql.SqlSelect.validate(SqlSelect.java:225) at org.apache.calcite.sql.validate.SqlValidatorImpl.validateScopedExpression(SqlValidatorImpl.java:918) at org.apache.calcite.sql.validate.SqlValidatorImpl.validate(SqlValidatorImpl.java:628) at org.apache.drill.exec.planner.sql.SqlConverter.validate(SqlConverter.java:192) at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.validateNode(DefaultSqlHandler.java:664) at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.validateAndConvert(DefaultSqlHandler.java:200) at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan(DefaultSqlHandler.java:173) at org.apache.drill.exec.planner.sql.DrillSqlWorker.getQueryPlan(DrillSqlWorker.java:155) at org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan(DrillSqlWorker.java:90) at org.apache.drill.exec.work.foreman.Foreman.runSQL(Foreman.java:584) at org.apache.drill.exec.work.foreman.Foreman.run
[jira] [Updated] (DRILL-6923) Show schemas uses default(user defined) schema first for resolving table from information_schema
[ https://issues.apache.org/jira/browse/DRILL-6923?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Igor Guzenko updated DRILL-6923: Summary: Show schemas uses default(user defined) schema first for resolving table from information_schema (was: Show schemas after use doesn't work with Hive authorization) > Show schemas uses default(user defined) schema first for resolving table from > information_schema > > > Key: DRILL-6923 > URL: https://issues.apache.org/jira/browse/DRILL-6923 > Project: Apache Drill > Issue Type: Bug > Components: Storage - Hive >Reporter: Igor Guzenko >Assignee: Igor Guzenko >Priority: Major > > *Abstract* > When Drill used with enabled Hive SQL Standard authorization, execution of > queries like, > {code:sql} > USE hive.db_general; > SHOW SCHEMAS LIKE 'hive.%'; {code} > results in error DrillRuntimeException: Failed to use the Hive authorization > components: Error getting object from metastore for Object > [type=TABLE_OR_VIEW, name=db_general.information_schema] . > *Details* > Consider showSchemas() test similar to one defined in > TestSqlStdBasedAuthorization : > {code:java} > @Test > public void showSchemas() throws Exception { > test("USE " + hivePluginName + "." + db_general); > testBuilder() > .sqlQuery("SHOW SCHEMAS LIKE 'hive.%'") > .unOrdered() > .baselineColumns("SCHEMA_NAME") > .baselineValues("hive.db_general") > .baselineValues("hive.default") > .go(); > } > {code} > Currently execution of such test will produce following stacktrace: > {code:none} > Caused by: org.apache.drill.common.exceptions.DrillRuntimeException: Failed > to use the Hive authorization components: Error getting object from metastore > for Object [type=TABLE_OR_VIEW, name=db_general.information_schema] > at > org.apache.drill.exec.store.hive.HiveAuthorizationHelper.authorize(HiveAuthorizationHelper.java:149) > at > org.apache.drill.exec.store.hive.HiveAuthorizationHelper.authorizeReadTable(HiveAuthorizationHelper.java:134) > at > org.apache.drill.exec.store.hive.DrillHiveMetaStoreClient$HiveClientWithAuthzWithCaching.getHiveReadEntry(DrillHiveMetaStoreClient.java:450) > at > org.apache.drill.exec.store.hive.schema.HiveSchemaFactory$HiveSchema.getSelectionBaseOnName(HiveSchemaFactory.java:233) > at > org.apache.drill.exec.store.hive.schema.HiveSchemaFactory$HiveSchema.getDrillTable(HiveSchemaFactory.java:214) > at > org.apache.drill.exec.store.hive.schema.HiveDatabaseSchema.getTable(HiveDatabaseSchema.java:63) > at > org.apache.calcite.jdbc.SimpleCalciteSchema.getImplicitTable(SimpleCalciteSchema.java:83) > at org.apache.calcite.jdbc.CalciteSchema.getTable(CalciteSchema.java:288) > at org.apache.calcite.sql.validate.EmptyScope.resolve_(EmptyScope.java:143) > at org.apache.calcite.sql.validate.EmptyScope.resolveTable(EmptyScope.java:99) > at > org.apache.calcite.sql.validate.DelegatingScope.resolveTable(DelegatingScope.java:203) > at > org.apache.calcite.sql.validate.IdentifierNamespace.resolveImpl(IdentifierNamespace.java:105) > at > org.apache.calcite.sql.validate.IdentifierNamespace.validateImpl(IdentifierNamespace.java:177) > at > org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:967) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:943) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:3032) > at > org.apache.drill.exec.planner.sql.SqlConverter$DrillValidator.validateFrom(SqlConverter.java:274) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:3014) > at > org.apache.drill.exec.planner.sql.SqlConverter$DrillValidator.validateFrom(SqlConverter.java:274) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelect(SqlValidatorImpl.java:3284) > at > org.apache.calcite.sql.validate.SelectNamespace.validateImpl(SelectNamespace.java:60) > at > org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:967) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:943) > at org.apache.calcite.sql.SqlSelect.validate(SqlSelect.java:225) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validateScopedExpression(SqlValidatorImpl.java:918) > at > org.apache.calcite.sql.validate.SqlValidatorImpl.validate(SqlValidatorImpl.java:628) > at > org.apache.drill.exec.planner.sql.SqlConverter.validate(SqlConverter.java:192) > at > org.apache.drill.exec.planner.sq