datastrato / trino-cascading-connector

Other
0 stars 1 forks source link

[Bug report] Trino cascading connector,Iceberg catalog unsupported datatype: boolean,array(integer),map(varchar, varchar),row(f1 integer, f2 varchar) #15

Open danhuawang opened 2 weeks ago

danhuawang commented 2 weeks ago

Version

main branch

Describe what's wrong

image image

Error message and/or stacktrace

trino:s2> select * from data_type_table2; Query 20241018_091229_00100_sgj86 failed: Unknown field data_type_table2.c_boolean:boolean java.lang.IllegalArgumentException: Unknown field data_type_table2.c_boolean:boolean at com.google.common.base.Preconditions.checkArgument(Preconditions.java:218) at io.trino.sql.analyzer.StatementAnalyzer$Visitor.analyzeTableOutputFields(StatementAnalyzer.java:2657) at io.trino.sql.analyzer.StatementAnalyzer$Visitor.visitTable(StatementAnalyzer.java:2295) at io.trino.sql.analyzer.StatementAnalyzer$Visitor.visitTable(StatementAnalyzer.java:521) at io.trino.sql.tree.Table.accept(Table.java:60) at io.trino.sql.tree.AstVisitor.process(AstVisitor.java:27) at io.trino.sql.analyzer.StatementAnalyzer$Visitor.process(StatementAnalyzer.java:540) at io.trino.sql.analyzer.StatementAnalyzer$Visitor.analyzeFrom(StatementAnalyzer.java:4869) at io.trino.sql.analyzer.StatementAnalyzer$Visitor.visitQuerySpecification(StatementAnalyzer.java:3062) at io.trino.sql.analyzer.StatementAnalyzer$Visitor.visitQuerySpecification(StatementAnalyzer.java:521) at io.trino.sql.tree.QuerySpecification.accept(QuerySpecification.java:155) at io.trino.sql.tree.AstVisitor.process(AstVisitor.java:27) at io.trino.sql.analyzer.StatementAnalyzer$Visitor.process(StatementAnalyzer.java:540) at io.trino.sql.analyzer.StatementAnalyzer$Visitor.process(StatementAnalyzer.java:548) at io.trino.sql.analyzer.StatementAnalyzer$Visitor.visitQuery(StatementAnalyzer.java:1558) at io.trino.sql.analyzer.StatementAnalyzer$Visitor.visitQuery(StatementAnalyzer.java:521) at io.trino.sql.tree.Query.accept(Query.java:118) at io.trino.sql.tree.AstVisitor.process(AstVisitor.java:27) at io.trino.sql.analyzer.StatementAnalyzer$Visitor.process(StatementAnalyzer.java:540) at io.trino.sql.analyzer.StatementAnalyzer.analyze(StatementAnalyzer.java:500) at io.trino.sql.analyzer.StatementAnalyzer.analyze(StatementAnalyzer.java:489) at io.trino.sql.analyzer.Analyzer.analyze(Analyzer.java:97) at io.trino.sql.analyzer.Analyzer.analyze(Analyzer.java:86) at io.trino.execution.SqlQueryExecution.analyze(SqlQueryExecution.java:274) at io.trino.execution.SqlQueryExecution.(SqlQueryExecution.java:209) at io.trino.execution.SqlQueryExecution$SqlQueryExecutionFactory.createQueryExecution(SqlQueryExecution.java:850) at io.trino.dispatcher.LocalDispatchQueryFactory.lambda$createDispatchQuery$0(LocalDispatchQueryFactory.java:153) at io.trino.$gen.Trino_435____20241018_025022_2.call(Unknown Source) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:131) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:76) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:82) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) at java.base/java.lang.Thread.run(Thread.java:1583)

trino:s2> select * from data_type_table3; Query 20241018_091248_00101_sgj86 failed: Unknown field data_type_table3.c_array:array(integer) java.lang.IllegalArgumentException: Unknown field data_type_table3.c_array:array(integer) at com.google.common.base.Preconditions.checkArgument(Preconditions.java:218) at io.trino.sql.analyzer.StatementAnalyzer$Visitor.analyzeTableOutputFields(StatementAnalyzer.java:2657) at io.trino.sql.analyzer.StatementAnalyzer$Visitor.visitTable(StatementAnalyzer.java:2295) at io.trino.sql.analyzer.StatementAnalyzer$Visitor.visitTable(StatementAnalyzer.java:521) at io.trino.sql.tree.Table.accept(Table.java:60) at io.trino.sql.tree.AstVisitor.process(AstVisitor.java:27) at io.trino.sql.analyzer.StatementAnalyzer$Visitor.process(StatementAnalyzer.java:540) at io.trino.sql.analyzer.StatementAnalyzer$Visitor.analyzeFrom(StatementAnalyzer.java:4869) at io.trino.sql.analyzer.StatementAnalyzer$Visitor.visitQuerySpecification(StatementAnalyzer.java:3062) at io.trino.sql.analyzer.StatementAnalyzer$Visitor.visitQuerySpecification(StatementAnalyzer.java:521) at io.trino.sql.tree.QuerySpecification.accept(QuerySpecification.java:155) at io.trino.sql.tree.AstVisitor.process(AstVisitor.java:27) at io.trino.sql.analyzer.StatementAnalyzer$Visitor.process(StatementAnalyzer.java:540) at io.trino.sql.analyzer.StatementAnalyzer$Visitor.process(StatementAnalyzer.java:548) at io.trino.sql.analyzer.StatementAnalyzer$Visitor.visitQuery(StatementAnalyzer.java:1558) at io.trino.sql.analyzer.StatementAnalyzer$Visitor.visitQuery(StatementAnalyzer.java:521) at io.trino.sql.tree.Query.accept(Query.java:118) at io.trino.sql.tree.AstVisitor.process(AstVisitor.java:27) at io.trino.sql.analyzer.StatementAnalyzer$Visitor.process(StatementAnalyzer.java:540) at io.trino.sql.analyzer.StatementAnalyzer.analyze(StatementAnalyzer.java:500) at io.trino.sql.analyzer.StatementAnalyzer.analyze(StatementAnalyzer.java:489) at io.trino.sql.analyzer.Analyzer.analyze(Analyzer.java:97) at io.trino.sql.analyzer.Analyzer.analyze(Analyzer.java:86) at io.trino.execution.SqlQueryExecution.analyze(SqlQueryExecution.java:274) at io.trino.execution.SqlQueryExecution.(SqlQueryExecution.java:209) at io.trino.execution.SqlQueryExecution$SqlQueryExecutionFactory.createQueryExecution(SqlQueryExecution.java:850) at io.trino.dispatcher.LocalDispatchQueryFactory.lambda$createDispatchQuery$0(LocalDispatchQueryFactory.java:153) at io.trino.$gen.Trino_435____20241018_025022_2.call(Unknown Source) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:131) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:76) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:82) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) at java.base/java.lang.Thread.run(Thread.java:1583)

How to reproduce

  1. Create Iceberg catalog in Trino1 (ap)
    
    call gravitino.system.create_catalog(
    'ice_2',
    'lakehouse-iceberg',
    map(
        array['uri', 'catalog-backend', 'warehouse','cloud.region-code', 'cloud.trino.connection-url', 'cloud.trino.connection-user', 'cloud.trino.connection-password'],
        array['thrift://***:9083', 'hive', 'hdfs://***:8020/user/iceberg/warehouse/TrinoQueryIT1','us-east-1', 'jdbc:trino://***:8080', 'admin', '']
    )
    );
2. Create table in Trino2 (us)

CREATE TABLE data_type_table2 ( c_boolean boolean, c_int integer, c_bigint bigint, c_real real, c_double double, c_decimal_10_0 decimal(10,0), c_decimal_10_2 decimal(10,2), c_decimal_38_5 decimal(38,5), c_varchar varchar, c_binary varbinary, c_date date, c_time time, c_array array(integer), c_map map(varchar, varchar), c_row row(f1 integer, f2 varchar) );

CREATE TABLE data_type_table3 ( c_int integer, c_bigint bigint, c_real real, c_double double, c_decimal_10_0 decimal(10,0), c_decimal_10_2 decimal(10,2), c_decimal_38_5 decimal(38,5), c_varchar varchar, c_binary varbinary, c_date date, c_time time, c_array array(integer), c_map map(varchar, varchar), c_row row(f1 integer, f2 varchar) );

CREATE TABLE data_type_table4 ( c_int integer, c_bigint bigint, c_real real, c_double double, c_decimal_10_0 decimal(10,0), c_decimal_10_2 decimal(10,2), c_decimal_38_5 decimal(38,5), c_varchar varchar, c_binary varbinary, c_date date, c_time time, c_map map(varchar, varchar), c_row row(f1 integer, f2 varchar) );

CREATE TABLE data_type_table5 ( c_int integer, c_bigint bigint, c_real real, c_double double, c_decimal_10_0 decimal(10,0), c_decimal_10_2 decimal(10,2), c_decimal_38_5 decimal(38,5), c_varchar varchar, c_binary varbinary, c_date date, c_time time, c_row row(f1 integer, f2 varchar) );

4. Select in Trino1(ap)

select from data_type_table2; select from data_type_table3; select from data_type_table4; select from data_type_table5;



### Additional context

_No response_
diqiu50 commented 4 days ago

These types is not support in the current version