Intermittent error while querying Presto JDBC tables

163 views
Skip to first unread message

jack.mc...@shopify.com

unread,
Aug 5, 2016, 3:01:39 PM8/5/16
to Presto
When I run this query against our Presto cluster:

SELECT TABLE_CAT, TABLE_SCHEM, TABLE_NAME, COLUMN_NAME, DATA_TYPE, TYPE_NAME, COLUMN_SIZE, BUFFER_LENGTH, DECIMAL_DIGITS, NUM_PREC_RADIX, NULLABLE, REMARKS, COLUMN_DEF, SQL_DATA_TYPE, SQL_DATETIME_SUB, CHAR_OCTET_LENGTH, ORDINAL_POSITION, IS_NULLABLE, SCOPE_CATALOG, SCOPE_SCHEMA, SCOPE_TABLE, SOURCE_DATA_TYPE, IS_AUTOINCREMENT, IS_GENERATEDCOLUMN FROM system.jdbc.columns WHERE TABLE_CAT = 'system' AND TABLE_SCHEM LIKE 'metadata' AND TABLE_NAME LIKE '' ORDER BY TABLE_CAT, TABLE_SCHEM, TABLE_NAME, ORDINAL_POSITION;


We receive the following exception:


java.lang.IllegalArgumentException: tableName is empty

    at com.facebook.presto.spi.SchemaUtil.checkNotEmpty(SchemaUtil.java:28)

    at com.facebook.presto.spi.SchemaTablePrefix.<init>(SchemaTablePrefix.java:42)

    at com.facebook.presto.metadata.QualifiedTablePrefix.asSchemaTablePrefix(QualifiedTablePrefix.java:97)

    at com.facebook.presto.metadata.MetadataManager.listTableColumns(MetadataManager.java:401)

    at com.facebook.presto.connector.system.jdbc.ColumnJdbcTable.cursor(ColumnJdbcTable.java:120)

    at com.facebook.presto.connector.system.SystemPageSourceProvider$1.cursor(SystemPageSourceProvider.java:126)

    at com.facebook.presto.split.MappedRecordSet.cursor(MappedRecordSet.java:53)

    at com.facebook.presto.spi.RecordPageSource.<init>(RecordPageSource.java:37)

    at com.facebook.presto.connector.system.SystemPageSourceProvider.createPageSource(SystemPageSourceProvider.java:105)

    at com.facebook.presto.split.PageSourceManager.createPageSource(PageSourceManager.java:48)

    at com.facebook.presto.operator.ScanFilterAndProjectOperator.createSourceIfNecessary(ScanFilterAndProjectOperator.java:292)

    at com.facebook.presto.operator.ScanFilterAndProjectOperator.isFinished(ScanFilterAndProjectOperator.java:180)

    at com.facebook.presto.operator.Driver.processInternal(Driver.java:375)

    at com.facebook.presto.operator.Driver.processFor(Driver.java:301)

    at com.facebook.presto.execution.SqlTaskExecution$DriverSplitRunner.processFor(SqlTaskExecution.java:622)

    at com.facebook.presto.execution.TaskExecutor$PrioritizedSplitRunner.process(TaskExecutor.java:529)

    at com.facebook.presto.execution.TaskExecutor$Runner.run(TaskExecutor.java:665)

    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

    at java.lang.Thread.run(Thread.java:745)


I get what this exception is trying to say, but this query comes from DataGrip (a popular querying tool used by our analysts made by JetBrains, https://www.jetbrains.com/datagrip/)


What should my next steps for making this work be?

Kamil Bajda-Pawlikowski

unread,
Aug 5, 2016, 3:36:24 PM8/5/16
to Presto

I can reproduce this problem on my end. 
When I modify your query so that TABLE_NAME LIKE '' is replaced with TABLE_NAME LIKE '%'
then it returns the result.

What is your intention for this query? Are you actually looking for a table which name is empty or are you trying to list all table columns?

Also, are you using JDBC driver? The open source one of the one from Teradata (www.teradata.com/presto) ?

Jack McCracken

unread,
Aug 5, 2016, 3:39:07 PM8/5/16
to presto...@googlegroups.com
We are using the open source driver.

The intention of the query is unclear, it is made by DataGrip when the users hit ‘refresh’.
--
You received this message because you are subscribed to a topic in the Google Groups "Presto" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/presto-users/M9chAiBrPfc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to presto-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kamil Bajda-Pawlikowski

unread,
Aug 5, 2016, 4:19:15 PM8/5/16
to Presto

OK, I believe this is a bug in Presto. Presto should return an empty result set for such query.
A similar problem occurs when trying  TABLE_SCHEM LIKE ''   (error message: "schemaName is empty").
Could you please file a GitHub issue for this bug and include a link to this discussion on the forum?

Thanks for catching this!
Reply all
Reply to author
Forward
0 new messages