[ 
https://issues.apache.org/jira/browse/FLINK-4686?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15529861#comment-15529861
 ] 

ASF GitHub Bot commented on FLINK-4686:
---------------------------------------

Github user twalthr commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2553#discussion_r80931954
  
    --- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/api/table/table.scala
 ---
    @@ -66,6 +66,17 @@ class Table(
       def getRelNode: RelNode = logicalPlan.toRelNode(relBuilder)
     
       /**
    +    * Returns the schema of this Table
    +    */
    +  def schema: Schema = new Schema(logicalPlan.output.map(_.name).toArray,
    --- End diff --
    
    I would call this `getSchema` to be consistent.


> Add possibility to get column names
> -----------------------------------
>
>                 Key: FLINK-4686
>                 URL: https://issues.apache.org/jira/browse/FLINK-4686
>             Project: Flink
>          Issue Type: New Feature
>          Components: Table API & SQL
>            Reporter: Timo Walther
>            Assignee: Jark Wu
>              Labels: starter
>
> For debugging and maybe for visualization in future (e.g. in a shell) it 
> would be good to have the possibilty to get the names of {{Table}} columns. 
> At the moment the user has no idea how the table columns are named; if they 
> need to be matched with POJO fields for example.
> My suggestion:
> {code}
> Schema s = table.schema();
> TypeInformation<?> type = s.getType(1);
> TypeInformation<?> type = s.getType("col");
> String s = s.getColumnName(1);
> String[] s = s.getColumnNames();
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to