@koolay, the Dremio query window has a “SQL context” feature that expands the dataset names to their full path. If you remove the context, are you able to run the query?
2020-07-29 07:05:29,173 [20dee04a-1aba-5e11-5a89-c13206520200/0:foreman-planning] WARN c.d.e.store.jdbc.JdbcSchemaFetcher - Took longer than 5 seconds to execute query `select count(*) from `mypaas_dmp`.`mypaas_dmp`.`aa``.
java.sql.SQLException: Fail to run sql:select count(*) from `mypaas_dmp`.`mypaas_dmp`.`aa`;, Error:[400] com.aliyun.odps.OdpsException: ODPS-0130161:[1,47] Parse exception - invalid token '.'
at com.aliyun.odps.jdbc.OdpsStatement.runSQL(OdpsStatement.java:732)
at com.aliyun.odps.jdbc.OdpsStatement.executeQuery(OdpsStatement.java:206)
at org.apache.commons.dbcp2.DelegatingStatement.executeQuery(DelegatingStatement.java:206)
at org.apache.commons.dbcp2.DelegatingStatement.executeQuery(DelegatingStatement.java:206)
at com.dremio.exec.store.jdbc.JdbcSchemaFetcher.executeQueryAndGetFirstLong(JdbcSchemaFetcher.java:444)
at com.dremio.exec.store.jdbc.JdbcSchemaFetcher.getRowCount(JdbcSchemaFetcher.java:387)
at com.dremio.exec.store.jdbc.JdbcDatasetMetadata.iterator(JdbcDatasetMetadata.java:89)
at com.dremio.exec.catalog.DatasetSaver.save(DatasetSaver.java:98)
at com.dremio.exec.catalog.DatasetSaver.save(DatasetSaver.java:154)
This particular exception is benign. It’s for calculating the rowcount which is used for planning (for example, when joining two tables the row count of the two is factored in to determine what is the better order for the join).
You can make this work as well by extending ArpSchemaFetcher and overriding getRowCount() and adding your own method to get the row count, then changing your ArpDialect implementation to return your JdbcSchemaFetcher.