chenchencc created FLINK-15511:
---------------------------------- Summary: flink 1.10 版本连接hive时 执行语句异常 Key: FLINK-15511 URL: https://issues.apache.org/jira/browse/FLINK-15511 Project: Flink Issue Type: Bug Components: Connectors / Hive Affects Versions: 1.10.0 Environment: ## hive 版本 1.1.2 Reporter: chenchencc ## 执行脚本 bin/start-scala-shell.sh yarn -qu bi -jm 1024m -tm 2048m import org.apache.flink.table.catalog.hive.HiveCatalog val name = "myhive" val defaultDatabase = "test" val hiveConfDir = "/etc/hive/conf" val version = "1.2.1" // or 1.2.1 2.3.4 val hive = new HiveCatalog(name, defaultDatabase, hiveConfDir, version) stenv.registerCatalog("myhive", hive) stenv.useCatalog("myhive") stenv.listTables stenv.sqlQuery("select * from gsp_test3").toAppendStream[Row].print ## gsp_test3表字段: id int name string txt file格式 ## 报错信息 scala> stenv.sqlQuery("select * from gsp_test3").toAppendStream[Row].print 20/01/08 14:36:13 INFO typeutils.TypeExtractor: class org.apache.flink.types.Row does not contain a getter for field fields 20/01/08 14:36:13 INFO typeutils.TypeExtractor: class org.apache.flink.types.Row does not contain a setter for field fields 20/01/08 14:36:13 INFO typeutils.TypeExtractor: Class class org.apache.flink.types.Row cannot be used as a POJO type because not all fields are valid POJO fields, and must be processed as GenericType. Please read the Flink documentation on "Data Types & Serialization" for details of the effect on performance. 20/01/08 14:36:13 WARN conf.HiveConf: HiveConf of name hive.server2.enable.impersonation does not exist 20/01/08 14:36:13 WARN conf.HiveConf: HiveConf of name hive.mapred.supports.subdirectories does not exist 20/01/08 14:36:13 INFO hive.metastore: Trying to connect to metastore with URI thrift://bgnode3:9083 20/01/08 14:36:13 INFO hive.metastore: Connected to metastore. 20/01/08 14:36:13 INFO configuration.GlobalConfiguration: Loading configuration property: jobmanager.rpc.address, localhost 20/01/08 14:36:13 INFO configuration.GlobalConfiguration: Loading configuration property: jobmanager.rpc.port, 6123 20/01/08 14:36:13 INFO configuration.GlobalConfiguration: Loading configuration property: jobmanager.heap.size, 1024m 20/01/08 14:36:13 INFO configuration.GlobalConfiguration: Loading configuration property: taskmanager.memory.process.size, 1024m 20/01/08 14:36:13 INFO configuration.GlobalConfiguration: Loading configuration property: taskmanager.numberOfTaskSlots, 1 20/01/08 14:36:13 INFO configuration.GlobalConfiguration: Loading configuration property: parallelism.default, 1 20/01/08 14:36:13 INFO configuration.GlobalConfiguration: Loading configuration property: jobmanager.execution.failover-strategy, region 20/01/08 14:36:13 INFO mapred.FileInputFormat: Total input paths to process : 1 20/01/08 14:36:13 INFO hive.HiveTableSource: Hive source(test.gsp_test3}) createInputSplits use time: 72 ms org.apache.flink.table.api.TableException: TableSource of type org.apache.flink.connectors.hive.HiveTableSource returned a DataStream of data type LEGACY('STRUCTURED_TYPE', 'ANY<org.apache.flink.table.dataformat.BaseRow, rO0ABXNyADhvcmcuYXBhY2hlLmZsaW5rLnRhYmxlLnJ1bnRpbWUudHlwZXV0aWxzLkJhc2VSb3dUeXBlSW5mbwAAAAAAAAABAgACWwAKZmllbGROYW1lc3QAE1tMamF2YS9sYW5nL1N0cmluZztbAAxsb2dpY2FsVHlwZXN0ADNbTG9yZy9hcGFjaGUvZmxpbmsvdGFibGUvdHlwZXMvbG9naWNhbC9Mb2dpY2FsVHlwZTt4cgA1b3JnLmFwYWNoZS5mbGluay5hcGkuamF2YS50eXBldXRpbHMuVHVwbGVUeXBlSW5mb0Jhc2UAAAAAAAAAAQIAAkkAC3RvdGFsRmllbGRzWwAFdHlwZXN0ADdbTG9yZy9hcGFjaGUvZmxpbmsvYXBpL2NvbW1vbi90eXBlaW5mby9UeXBlSW5mb3JtYXRpb247eHIAM29yZy5hcGFjaGUuZmxpbmsuYXBpLmNvbW1vbi50eXBldXRpbHMuQ29tcG9zaXRlVHlwZQAAAAAAAAABAgABTAAJdHlwZUNsYXNzdAARTGphdmEvbGFuZy9DbGFzczt4cgA0b3JnLmFwYWNoZS5mbGluay5hcGkuY29tbW9uLnR5cGVpbmZvLlR5cGVJbmZvcm1hdGlvbpSNyEi6s3rrAgAA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hbC5Mb2dpY2FsVHlwZTsYNEes23GhNgIAAHhwAAAAAnNyACxvcmcuYXBhY2hlLmZsaW5rLnRhYmxlLnR5cGVzLmxvZ2ljYWwuSW50VHlwZQhSCPRJWrHYAgAAeHIAMG9yZy5hcGFjaGUuZmxpbmsudGFibGUudHlwZXMubG9naWNhbC5Mb2dpY2FsVHlwZZmP7fGmbmA1AgACWgAKaXNOdWxsYWJsZUwACHR5cGVSb290dAA2TG9yZy9hcGFjaGUvZmxpbmsvdGFibGUvdHlwZXMvbG9naWNhbC9Mb2dpY2FsVHlwZVJvb3Q7eHABfnIANG9yZy5hcGFjaGUuZmxpbmsudGFibGUudHlwZXMubG9naWNhbC5Mb2dpY2FsVHlwZVJvb3QAAAAAAAAAABIAAHhyAA5qYXZhLmxhbmcuRW51bQAAAAAAAAAAEgAAeHB0AAdJTlRFR0VSc3IAMG9yZy5hcGFjaGUuZmxpbmsudGFibGUudHlwZXMubG9naWNhbC5WYXJDaGFyVHlwZV6wliIAWyZdAgABSQAGbGVuZ3RoeHEAfgA4AX5xAH4AO3QAB1ZBUkNIQVJ_____>') that does not match with the data type ROW<`id` INT, `name` STRING> declared by the TableSource.getProducedDataType() method. Please validate the implementation of the TableSource. at org.apache.flink.table.plan.nodes.datastream.StreamTableSourceScan.translateToPlan(StreamTableSourceScan.scala:116) at org.apache.flink.table.planner.StreamPlanner.translateToCRow(StreamPlanner.scala:251) at org.apache.flink.table.planner.StreamPlanner.translateOptimized(StreamPlanner.scala:412) at org.apache.flink.table.planner.StreamPlanner.translateToType(StreamPlanner.scala:402) at org.apache.flink.table.planner.StreamPlanner.org$apache$flink$table$planner$StreamPlanner$$translate(StreamPlanner.scala:180) at org.apache.flink.table.planner.StreamPlanner$$anonfun$translate$1.apply(StreamPlanner.scala:117) at org.apache.flink.table.planner.StreamPlanner$$anonfun$translate$1.apply(StreamPlanner.scala:117) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234) at scala.collection.Iterator$class.foreach(Iterator.scala:891) at scala.collection.AbstractIterator.foreach(Iterator.scala:1334) at scala.collection.IterableLike$class.foreach(IterableLike.scala:72) at scala.collection.AbstractIterable.foreach(Iterable.scala:54) at scala.collection.TraversableLike$class.map(TraversableLike.scala:234) at scala.collection.AbstractTraversable.map(Traversable.scala:104) at org.apache.flink.table.planner.StreamPlanner.translate(StreamPlanner.scala:117) at org.apache.flink.table.api.scala.internal.StreamTableEnvironmentImpl.toDataStream(StreamTableEnvironmentImpl.scala:210) at org.apache.flink.table.api.scala.internal.StreamTableEnvironmentImpl.toAppendStream(StreamTableEnvironmentImpl.scala:107) at org.apache.flink.table.api.scala.TableConversions.toAppendStream(TableConversions.scala:101) ... 30 elided -- This message was sent by Atlassian Jira (v8.3.4#803005) |
Free forum by Nabble | Edit this page |