[
https://issues.apache.org/jira/browse/FLINK-5280?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15802704#comment-15802704
]
ASF GitHub Bot commented on FLINK-5280:
---------------------------------------
Github user fhueske commented on a diff in the pull request:
https://github.com/apache/flink/pull/3039#discussion_r94853135
--- Diff:
flink-libraries/flink-table/src/test/scala/org/apache/flink/table/utils/CommonTestData.scala
---
@@ -60,4 +67,52 @@ object CommonTestData {
ignoreComments = "%"
)
}
+
+ def getNestedTableSource: BatchTableSource[Person] = {
+ new AbstractBatchTableSource[Person] {
+ override def getDataSet(execEnv: ExecutionEnvironment):
DataSet[Person] = {
+ val executionEnvironment =
ExecutionEnvironment.getExecutionEnvironment
+ executionEnvironment.fromCollection(
+ util.Arrays.asList(
+ new Person("Mike", "Smith", new Address("5th Ave",
"New-York")),
+ new Person("Sally", "Miller", new Address("Potsdamer Platz",
"Berlin")),
+ new Person("Bob", "Taylor", new Address("Pearse Street",
"Dublin"))),
+ getReturnType
+ )
+ }
+
+ /** Returns the [[TypeInformation]] for the return type of the
[[TableSource]]. */
+ override def getReturnType: TypeInformation[Person] = new
PojoTypeInfo[Person](
--- End diff --
`TypeExtractor.getForClass(Person)` should return a `PojoTypeInfo[Person]`.
No need to fiddle with Java reflection ;-)
> Extend TableSource to support nested data
> -----------------------------------------
>
> Key: FLINK-5280
> URL: https://issues.apache.org/jira/browse/FLINK-5280
> Project: Flink
> Issue Type: Improvement
> Components: Table API & SQL
> Affects Versions: 1.2.0
> Reporter: Fabian Hueske
> Assignee: Ivan Mushketyk
>
> The {{TableSource}} interface does currently only support the definition of
> flat rows.
> However, there are several storage formats for nested data that should be
> supported such as Avro, Json, Parquet, and Orc. The Table API and SQL can
> also natively handle nested rows.
> The {{TableSource}} interface and the code to register table sources in
> Calcite's schema need to be extended to support nested data.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)