[
https://issues.apache.org/jira/browse/FLINK-6099?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Flink Jira Bot updated FLINK-6099:
----------------------------------
Labels: auto-deprioritized-minor newbie (was: newbie stale-minor)
Priority: Not a Priority (was: Minor)
This issue was labeled "stale-minor" 7 days ago and has not received any
updates so it is being deprioritized. If this ticket is actually Minor, please
raise the priority and ask a committer to assign you the issue or revive the
public discussion.
> not able to auto infer the row type when getting information from jdbc
> vertica
> -------------------------------------------------------------------------------
>
> Key: FLINK-6099
> URL: https://issues.apache.org/jira/browse/FLINK-6099
> Project: Flink
> Issue Type: Improvement
> Components: API / DataSet
> Affects Versions: 1.3.0
> Environment: linux , flink 1.3.0 with scala 2.10
> Reporter: naveen holla U
> Priority: Not a Priority
> Labels: auto-deprioritized-minor, newbie
> Original Estimate: 3h
> Remaining Estimate: 3h
>
> How to automatically infer the row type information for a given query
> import org.apache.flink.api.scala._
> import org.apache.flink.table.api.TableEnvironment
> import org.apache.flink.api.java.io.jdbc.JDBCInputFormat
> import org.apache.flink.api.java.typeutils.RowTypeInfo
> import org.apache.flink.api.common.typeinfo.TypeInformation
> var fieldTypes: Array[TypeInformation[_]] =
> Array(createTypeInformation[String],createTypeInformation[String],createTypeInformation[String])
> var fieldNames: Array[String] = Array("UUID", "Name","instanceid")
> val rowTypeInfo = new RowTypeInfo( fieldTypes, fieldNames )
> val inputFormat =
> JDBCInputFormat.buildJDBCInputFormat().setDrivername("com.vertica.jdbc.Driver").setDBUrl("jdbc:vertica://x.x.x.x:5433/hfdb").setUsername("user").setPassword("password").setQuery("select
> * from test").setRowTypeInfo(rowTypeInfo).finish()
> val dataset = benv.createInput(inputFormat)
> dataset.print()
> import org.apache.flink.api.scala._
> import org.apache.flink.table.api.TableEnvironment
> import org.apache.flink.api.java.io.jdbc.JDBCInputFormat
> import org.apache.flink.api.java.typeutils.RowTypeInfo
> import org.apache.flink.api.common.typeinfo.TypeInformation
> var fieldTypes: Array[TypeInformation[_]] =
> Array(createTypeInformation[String],createTypeInformation[String],createTypeInformation[String])
> var fieldNames: Array[String] = Array("UUID", "Name","instanceid")
> val rowTypeInfo = new RowTypeInfo( fieldTypes, fieldNames )
> val inputFormat =
> JDBCInputFormat.buildJDBCInputFormat().setDrivername("com.vertica.jdbc.Driver").setDBUrl("jdbc:vertica://x.x.x.x:5433/hfdb").setUsername("user").setPassword("password").setQuery("select
> * from test").setRowTypeInfo(rowTypeInfo).finish()
> val dataset = benv.createInput(inputFormat)
> dataset.print()
> So in the above code we have to specify the type of the rows which we are
> getting . is there a way to get the answer without setting row type ?
--
This message was sent by Atlassian Jira
(v8.3.4#803005)