You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Flink Jira Bot (Jira)" <ji...@apache.org> on 2021/10/21 10:44:01 UTC

[jira] [Updated] (FLINK-6099) not able to auto infer the row type when getting information from jdbc vertica

     [ https://issues.apache.org/jira/browse/FLINK-6099?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Flink Jira Bot updated FLINK-6099:
----------------------------------
    Labels: newbie stale-minor  (was: newbie)

I am the [Flink Jira Bot|https://github.com/apache/flink-jira-bot/] and I help the community manage its development. I see this issues has been marked as Minor but is unassigned and neither itself nor its Sub-Tasks have been updated for 180 days. I have gone ahead and marked it "stale-minor". If this ticket is still Minor, please either assign yourself or give an update. Afterwards, please remove the label or in 7 days the issue will be deprioritized.


> 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: Minor
>              Labels: newbie, stale-minor
>   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)