Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metadata $files table on iceberg connector throws an error #16473

Closed
ricardopereira33 opened this issue Mar 9, 2023 · 4 comments · Fixed by #16519
Closed

Metadata $files table on iceberg connector throws an error #16473

ricardopereira33 opened this issue Mar 9, 2023 · 4 comments · Fixed by #16519
Labels
bug Something isn't working

Comments

@ricardopereira33
Copy link

On the last version 409, we start getting the following error when we try to query the $files metadata table from an Iceberg table:

Error: TrinoQueryError(type=INTERNAL_ERROR, name=GENERIC_INTERNAL_ERROR, message="Unknown type: class java.util.ArrayList", query_id=20230309_140747_03630_wb3r2)

Query:

SELECT * FROM <schema>."<table>$files"

Strack Trace:

java.lang.IllegalArgumentException: Unknown type: class java.util.ArrayList
	at io.trino.spi.connector.InMemoryRecordSet.sizeOf(InMemoryRecordSet.java:328)
	at io.trino.spi.connector.InMemoryRecordSet$InMemoryRecordCursor.advanceNextPosition(InMemoryRecordSet.java:111)
	at io.trino.split.MappedRecordSet$MappedRecordCursor.advanceNextPosition(MappedRecordSet.java:89)
	at io.trino.spi.connector.RecordPageSource.getNextPage(RecordPageSource.java:88)
	at io.trino.operator.TableScanOperator.getOutput(TableScanOperator.java:301)
	at io.trino.operator.Driver.processInternal(Driver.java:394)
	at io.trino.operator.Driver.lambda$process$8(Driver.java:297)
	at io.trino.operator.Driver.tryWithLock(Driver.java:689)
	at io.trino.operator.Driver.process(Driver.java:289)
	at io.trino.operator.Driver.processForDuration(Driver.java:260)
	at io.trino.execution.SqlTaskExecution$DriverSplitRunner.processFor(SqlTaskExecution.java:773)
	at io.trino.execution.executor.PrioritizedSplitRunner.process(PrioritizedSplitRunner.java:165)
	at io.trino.execution.executor.TaskExecutor$TaskRunner.run(TaskExecutor.java:523)
	at io.trino.$gen.Trino_409____20230308_140820_2.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)
@alexjo2144
Copy link
Member

@krvikash would you be able to take a look tomorrow? I think this relates to your changes

@findepi findepi added the bug Something isn't working label Mar 9, 2023
@findinpath
Copy link
Contributor

See the fix here 009753c

@electrum
Copy link
Member

electrum commented Mar 9, 2023

We should change FilesTable (and the other system tables) to use pageSource() instead of cursor(). RecordCursor is inefficient and ends up being more complicated to use for complex types.

@findepi
Copy link
Member

findepi commented Mar 10, 2023

We shouldn't prevent doing a bug fix because we would want a refactor, unless bugfix and refactor are comparable in complexity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

5 participants