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

Ovidiu Marcu commented on FLINK-2099:
-------------------------------------

I've just gave a short look.  
After merging FLINK-2961 and making a little change in 
flink-staging/flink-table/src/main/scala/org/apache/flink/api/table/sql/calcite/RexToExpr.scala
 (case DATE => Literal(literal.getValue3, BasicTypeInfo.DATE_TYPE_INFO) I have:
val actual = sqlTestUtil.translator.translate("""
      SELECT *
      FROM TABLE5
      WHERE FIELD2 < DATE '2015-10-31'""")
    println(actual) //-> 
Expression(Filter(Root(org.apache.flink.api.java.operators.MapOperator@27ad4dbe,ArraySeq((FIELD1,Integer),
 (FIELD2,String))), 'FIELD2.cast(Date) < 16739))

How can I filter a Date with Table api?

In SqlTestUtil I have
val table5 = env.fromElements((1, "2015-10-31"), (2, "2015-10-30")).as('FIELD1, 
'FIELD2)
  tableRegistry.registerTable("TABLE5", table5)
All other tests are ok (well, except Ignored ones).

> Add a SQL API
> -------------
>
>                 Key: FLINK-2099
>                 URL: https://issues.apache.org/jira/browse/FLINK-2099
>             Project: Flink
>          Issue Type: New Feature
>          Components: Table API
>            Reporter: Timo Walther
>            Assignee: Timo Walther
>
> From the mailing list:
> Fabian: Flink's Table API is pretty close to what SQL provides. IMO, the best
> approach would be to leverage that and build a SQL parser (maybe together
> with a logical optimizer) on top of the Table API. Parser (and optimizer)
> could be built using Apache Calcite which is providing exactly this.
> Since the Table API is still a fairly new component and not very feature
> rich, it might make sense to extend and strengthen it before putting
> something major on top.
> Ted: It would also be relatively simple (I think) to retarget drill to Flink 
> if
> Flink doesn't provide enough typing meta-data to do traditional SQL.



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

Reply via email to