You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by fh...@apache.org on 2016/12/16 15:47:11 UTC

[42/47] flink git commit: [FLINK-4704] [table] Refactor package structure of flink-table.

[FLINK-4704] [table] Refactor package structure of flink-table.

This closes #2958.


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/ffe9ec8e
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/ffe9ec8e
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/ffe9ec8e

Branch: refs/heads/master
Commit: ffe9ec8ee1cf73867018e70dd1d35cb1efa267c3
Parents: 48ef46a
Author: Anton Mushin <an...@epam.com>
Authored: Wed Dec 7 16:42:42 2016 +0400
Committer: Fabian Hueske <fh...@apache.org>
Committed: Fri Dec 16 16:41:20 2016 +0100

----------------------------------------------------------------------
 docs/dev/table_api.md                           |   14 +-
 .../kafka/Kafka010JsonTableSource.java          |    2 +-
 .../connectors/kafka/Kafka010TableSource.java   |    2 +-
 .../kafka/Kafka08JsonTableSource.java           |    2 +-
 .../connectors/kafka/Kafka08TableSource.java    |    2 +-
 .../kafka/Kafka09JsonTableSource.java           |    2 +-
 .../connectors/kafka/Kafka09TableSource.java    |    2 +-
 .../connectors/kafka/KafkaJsonTableSource.java  |    2 +-
 .../connectors/kafka/KafkaTableSink.java        |    2 +-
 .../connectors/kafka/KafkaTableSource.java      |    2 +-
 .../flink/api/java/table/package-info.java      |   63 -
 .../apache/flink/api/table/explain/Node.java    |  145 --
 .../flink/api/table/explain/PlanJsonParser.java |  152 --
 .../flink/examples/java/WordCountSQL.java       |   87 -
 .../flink/examples/java/WordCountTable.java     |   85 -
 .../flink/table/api/java/package-info.java      |   65 +
 .../flink/table/examples/java/WordCountSQL.java |   87 +
 .../table/examples/java/WordCountTable.java     |   85 +
 .../org/apache/flink/table/explain/Node.java    |  145 ++
 .../flink/table/explain/PlanJsonParser.java     |  152 ++
 .../api/java/table/BatchTableEnvironment.scala  |  181 ---
 .../api/java/table/StreamTableEnvironment.scala |  183 ---
 .../flink/api/java/table/groupWindows.scala     |   84 -
 .../api/scala/table/BatchTableEnvironment.scala |  154 --
 .../api/scala/table/DataSetConversions.scala    |   63 -
 .../api/scala/table/DataStreamConversions.scala |   63 -
 .../scala/table/StreamTableEnvironment.scala    |  156 --
 .../api/scala/table/TableConversions.scala      |   62 -
 .../flink/api/scala/table/expressionDsl.scala   |  691 --------
 .../flink/api/scala/table/groupWindows.scala    |   85 -
 .../apache/flink/api/scala/table/package.scala  |   90 --
 .../flink/api/table/BatchTableEnvironment.scala |  311 ----
 .../apache/flink/api/table/CalciteConfig.scala  |  161 --
 .../api/table/FlinkCalciteSqlValidator.scala    |   47 -
 .../flink/api/table/FlinkPlannerImpl.scala      |  177 --
 .../flink/api/table/FlinkRelBuilder.scala       |  103 --
 .../flink/api/table/FlinkTypeFactory.scala      |  212 ---
 .../flink/api/table/FlinkTypeSystem.scala       |   51 -
 .../api/table/StreamTableEnvironment.scala      |  351 ----
 .../apache/flink/api/table/TableConfig.scala    |  107 --
 .../flink/api/table/TableEnvironment.scala      |  537 ------
 .../org/apache/flink/api/table/Types.scala      |   45 -
 .../api/table/codegen/CodeGenException.scala    |   24 -
 .../flink/api/table/codegen/CodeGenUtils.scala  |  293 ----
 .../flink/api/table/codegen/CodeGenerator.scala | 1522 ------------------
 .../flink/api/table/codegen/Compiler.scala      |   41 -
 .../api/table/codegen/ExpressionReducer.scala   |  119 --
 .../flink/api/table/codegen/Indenter.scala      |   54 -
 .../table/codegen/calls/BuiltInMethods.scala    |   39 -
 .../api/table/codegen/calls/CallGenerator.scala |   74 -
 .../codegen/calls/CurrentTimePointCallGen.scala |   58 -
 .../table/codegen/calls/FloorCeilCallGen.scala  |   73 -
 .../table/codegen/calls/FunctionGenerator.scala |  369 -----
 .../api/table/codegen/calls/MethodCallGen.scala |   44 -
 .../codegen/calls/MultiTypeMethodCallGen.scala  |   44 -
 .../table/codegen/calls/NotCallGenerator.scala  |   37 -
 .../codegen/calls/ScalarFunctionCallGen.scala   |   95 --
 .../table/codegen/calls/ScalarOperators.scala   | 1025 ------------
 .../codegen/calls/TableFunctionCallGen.scala    |   83 -
 .../api/table/codegen/calls/TrimCallGen.scala   |   52 -
 .../flink/api/table/codegen/generated.scala     |   43 -
 .../flink/api/table/codegen/package.scala       |   25 -
 .../org/apache/flink/api/table/exceptions.scala |   73 -
 .../api/table/expressions/Expression.scala      |   88 -
 .../table/expressions/ExpressionParser.scala    |  489 ------
 .../api/table/expressions/ExpressionUtils.scala |  154 --
 .../api/table/expressions/InputTypeSpec.scala   |   57 -
 .../api/table/expressions/aggregations.scala    |  100 --
 .../api/table/expressions/arithmetic.scala      |  158 --
 .../flink/api/table/expressions/array.scala     |  146 --
 .../flink/api/table/expressions/call.scala      |  159 --
 .../flink/api/table/expressions/cast.scala      |   53 -
 .../api/table/expressions/comparison.scala      |  160 --
 .../flink/api/table/expressions/composite.scala |  106 --
 .../api/table/expressions/fieldExpression.scala |  152 --
 .../flink/api/table/expressions/literals.scala  |  120 --
 .../flink/api/table/expressions/logic.scala     |  107 --
 .../api/table/expressions/mathExpressions.scala |  129 --
 .../flink/api/table/expressions/ordering.scala  |   54 -
 .../flink/api/table/expressions/package.scala   |   29 -
 .../table/expressions/stringExpressions.scala   |  279 ----
 .../flink/api/table/expressions/symbols.scala   |  132 --
 .../flink/api/table/expressions/time.scala      |  377 -----
 .../table/expressions/windowProperties.scala    |   57 -
 .../api/table/functions/ScalarFunction.scala    |  100 --
 .../api/table/functions/TableFunction.scala     |  138 --
 .../table/functions/UserDefinedFunction.scala   |   27 -
 .../table/functions/utils/MathFunctions.scala   |   29 -
 .../functions/utils/ScalarSqlFunction.scala     |  182 ---
 .../functions/utils/TableSqlFunction.scala      |  120 --
 .../utils/UserDefinedFunctionUtils.scala        |  338 ----
 .../org/apache/flink/api/table/package.scala    |   34 -
 .../api/table/plan/ProjectionTranslator.scala   |  263 ---
 .../flink/api/table/plan/cost/DataSetCost.scala |  150 --
 .../table/plan/cost/DataSetCostFactory.scala    |   47 -
 .../api/table/plan/logical/LogicalNode.scala    |  162 --
 .../api/table/plan/logical/LogicalWindow.scala  |   36 -
 .../api/table/plan/logical/Resolvable.scala     |   43 -
 .../api/table/plan/logical/groupWindows.scala   |  258 ---
 .../api/table/plan/logical/operators.scala      |  692 --------
 .../logical/rel/LogicalWindowAggregate.scala    |  114 --
 .../api/table/plan/nodes/FlinkAggregate.scala   |   68 -
 .../flink/api/table/plan/nodes/FlinkCalc.scala  |  172 --
 .../api/table/plan/nodes/FlinkCorrelate.scala   |  163 --
 .../flink/api/table/plan/nodes/FlinkRel.scala   |  103 --
 .../table/plan/nodes/dataset/BatchScan.scala    |   97 --
 .../nodes/dataset/BatchTableSourceScan.scala    |   71 -
 .../plan/nodes/dataset/DataSetAggregate.scala   |  166 --
 .../table/plan/nodes/dataset/DataSetCalc.scala  |  136 --
 .../plan/nodes/dataset/DataSetConvention.scala  |   47 -
 .../plan/nodes/dataset/DataSetCorrelate.scala   |  139 --
 .../plan/nodes/dataset/DataSetIntersect.scala   |  133 --
 .../table/plan/nodes/dataset/DataSetJoin.scala  |  229 ---
 .../table/plan/nodes/dataset/DataSetMinus.scala |  145 --
 .../table/plan/nodes/dataset/DataSetRel.scala   |   74 -
 .../table/plan/nodes/dataset/DataSetScan.scala  |   64 -
 .../nodes/dataset/DataSetSingleRowJoin.scala    |  193 ---
 .../table/plan/nodes/dataset/DataSetSort.scala  |  194 ---
 .../table/plan/nodes/dataset/DataSetUnion.scala |  104 --
 .../plan/nodes/dataset/DataSetValues.scala      |  111 --
 .../nodes/datastream/DataStreamAggregate.scala  |  358 ----
 .../plan/nodes/datastream/DataStreamCalc.scala  |  104 --
 .../nodes/datastream/DataStreamConvention.scala |   47 -
 .../nodes/datastream/DataStreamCorrelate.scala  |  134 --
 .../plan/nodes/datastream/DataStreamRel.scala   |   45 -
 .../plan/nodes/datastream/DataStreamScan.scala  |   64 -
 .../plan/nodes/datastream/DataStreamUnion.scala |   75 -
 .../nodes/datastream/DataStreamValues.scala     |   97 --
 .../plan/nodes/datastream/StreamScan.scala      |  107 --
 .../datastream/StreamTableSourceScan.scala      |   62 -
 .../rules/EnumerableToLogicalTableScan.scala    |   49 -
 .../api/table/plan/rules/FlinkRuleSets.scala    |  161 --
 .../dataSet/BatchTableSourceScanRule.scala      |   73 -
 .../rules/dataSet/DataSetAggregateRule.scala    |   79 -
 .../DataSetAggregateWithNullValuesRule.scala    |   97 --
 .../plan/rules/dataSet/DataSetCalcRule.scala    |   52 -
 .../rules/dataSet/DataSetCorrelateRule.scala    |   91 --
 .../rules/dataSet/DataSetIntersectRule.scala    |   54 -
 .../plan/rules/dataSet/DataSetJoinRule.scala    |   73 -
 .../plan/rules/dataSet/DataSetMinusRule.scala   |   56 -
 .../plan/rules/dataSet/DataSetScanRule.scala    |   66 -
 .../dataSet/DataSetSingleRowJoinRule.scala      |   82 -
 .../plan/rules/dataSet/DataSetSortRule.scala    |   54 -
 .../plan/rules/dataSet/DataSetUnionRule.scala   |   64 -
 .../plan/rules/dataSet/DataSetValuesRule.scala  |   51 -
 ...ushProjectIntoBatchTableSourceScanRule.scala |   84 -
 .../datastream/DataStreamAggregateRule.scala    |   78 -
 .../rules/datastream/DataStreamCalcRule.scala   |   53 -
 .../datastream/DataStreamCorrelateRule.scala    |   91 --
 .../rules/datastream/DataStreamScanRule.scala   |   64 -
 .../rules/datastream/DataStreamUnionRule.scala  |   53 -
 .../rules/datastream/DataStreamValuesRule.scala |   51 -
 .../datastream/StreamTableSourceScanRule.scala  |   76 -
 .../rules/util/RexProgramProjectExtractor.scala |  120 --
 .../table/plan/schema/ArrayRelDataType.scala    |   53 -
 .../plan/schema/CompositeRelDataType.scala      |   83 -
 .../api/table/plan/schema/DataSetTable.scala    |   51 -
 .../api/table/plan/schema/DataStreamTable.scala |   28 -
 .../api/table/plan/schema/FlinkTable.scala      |   66 -
 .../plan/schema/FlinkTableFunctionImpl.scala    |   84 -
 .../table/plan/schema/GenericRelDataType.scala  |   53 -
 .../flink/api/table/plan/schema/RelTable.scala  |   46 -
 .../table/plan/schema/TableSourceTable.scala    |   30 -
 .../table/runtime/CountPartitionFunction.scala  |   40 -
 .../api/table/runtime/FlatJoinRunner.scala      |   52 -
 .../flink/api/table/runtime/FlatMapRunner.scala |   52 -
 .../runtime/IntersectCoGroupFunction.scala      |   42 -
 .../api/table/runtime/LimitFilterFunction.scala |   64 -
 .../api/table/runtime/MapJoinLeftRunner.scala   |   33 -
 .../api/table/runtime/MapJoinRightRunner.scala  |   33 -
 .../flink/api/table/runtime/MapRunner.scala     |   51 -
 .../api/table/runtime/MapSideJoinRunner.scala   |   51 -
 .../table/runtime/MinusCoGroupFunction.scala    |   47 -
 .../api/table/runtime/aggregate/Aggregate.scala |   96 --
 .../AggregateAllTimeWindowFunction.scala        |   52 -
 .../aggregate/AggregateAllWindowFunction.scala  |   41 -
 .../aggregate/AggregateMapFunction.scala        |   62 -
 .../AggregateReduceCombineFunction.scala        |   82 -
 .../AggregateReduceGroupFunction.scala          |   92 --
 .../aggregate/AggregateTimeWindowFunction.scala |   57 -
 .../table/runtime/aggregate/AggregateUtil.scala |  593 -------
 .../aggregate/AggregateWindowFunction.scala     |   46 -
 .../table/runtime/aggregate/AvgAggregate.scala  |  296 ----
 .../runtime/aggregate/CountAggregate.scala      |   55 -
 ...rementalAggregateAllTimeWindowFunction.scala |   68 -
 .../IncrementalAggregateAllWindowFunction.scala |   79 -
 .../IncrementalAggregateReduceFunction.scala    |   63 -
 ...IncrementalAggregateTimeWindowFunction.scala |   69 -
 .../IncrementalAggregateWindowFunction.scala    |   81 -
 .../table/runtime/aggregate/MaxAggregate.scala  |  171 --
 .../table/runtime/aggregate/MinAggregate.scala  |  170 --
 .../table/runtime/aggregate/SumAggregate.scala  |  130 --
 .../aggregate/TimeWindowPropertyCollector.scala |   54 -
 .../table/runtime/io/ValuesInputFormat.scala    |   53 -
 .../flink/api/table/sinks/BatchTableSink.scala  |   31 -
 .../flink/api/table/sinks/CsvTableSink.scala    |   86 -
 .../flink/api/table/sinks/StreamTableSink.scala |   31 -
 .../flink/api/table/sinks/TableSink.scala       |   58 -
 .../flink/api/table/sinks/TableSinkBase.scala   |   67 -
 .../api/table/sources/BatchTableSource.scala    |   36 -
 .../api/table/sources/CsvTableSource.scala      |  123 --
 .../table/sources/ProjectableTableSource.scala  |   38 -
 .../api/table/sources/StreamTableSource.scala   |   37 -
 .../flink/api/table/sources/TableSource.scala   |   41 -
 .../org/apache/flink/api/table/table.scala      |  922 -----------
 .../apache/flink/api/table/trees/TreeNode.scala |  115 --
 .../api/table/typeutils/InternalTypeInfo.scala  |   81 -
 .../table/typeutils/RowIntervalTypeInfo.scala   |   36 -
 .../table/typeutils/TimeIntervalTypeInfo.scala  |  113 --
 .../api/table/typeutils/TypeCheckUtils.scala    |   94 --
 .../api/table/typeutils/TypeCoercion.scala      |  121 --
 .../api/table/typeutils/TypeConverter.scala     |  155 --
 .../api/table/validate/FunctionCatalog.scala    |  320 ----
 .../api/table/validate/ValidationResult.scala   |   53 -
 .../org/apache/flink/api/table/windows.scala    |  390 -----
 .../flink/examples/scala/StreamSQLExample.scala |   76 -
 .../examples/scala/StreamTableExample.scala     |   72 -
 .../flink/examples/scala/TPCHQuery3Table.scala  |  180 ---
 .../flink/examples/scala/WordCountSQL.scala     |   62 -
 .../flink/examples/scala/WordCountTable.scala   |   62 -
 .../flink/table/api/BatchTableEnvironment.scala |  312 ++++
 .../table/api/StreamTableEnvironment.scala      |  352 ++++
 .../apache/flink/table/api/TableConfig.scala    |  109 ++
 .../flink/table/api/TableEnvironment.scala      |  538 +++++++
 .../org/apache/flink/table/api/Types.scala      |   45 +
 .../org/apache/flink/table/api/exceptions.scala |   73 +
 .../table/api/java/BatchTableEnvironment.scala  |  181 +++
 .../table/api/java/StreamTableEnvironment.scala |  183 +++
 .../flink/table/api/java/groupWindows.scala     |   84 +
 .../org/apache/flink/table/api/package.scala    |   34 +
 .../table/api/scala/BatchTableEnvironment.scala |  154 ++
 .../table/api/scala/DataSetConversions.scala    |   63 +
 .../table/api/scala/DataStreamConversions.scala |   63 +
 .../api/scala/StreamTableEnvironment.scala      |  155 ++
 .../table/api/scala/TableConversions.scala      |   61 +
 .../flink/table/api/scala/expressionDsl.scala   |  691 ++++++++
 .../flink/table/api/scala/groupWindows.scala    |   85 +
 .../apache/flink/table/api/scala/package.scala  |   93 ++
 .../org/apache/flink/table/api/table.scala      |  924 +++++++++++
 .../org/apache/flink/table/api/windows.scala    |  390 +++++
 .../flink/table/calcite/CalciteConfig.scala     |  161 ++
 .../calcite/FlinkCalciteSqlValidator.scala      |   47 +
 .../flink/table/calcite/FlinkPlannerImpl.scala  |  178 ++
 .../flink/table/calcite/FlinkRelBuilder.scala   |  103 ++
 .../flink/table/calcite/FlinkTypeFactory.scala  |  214 +++
 .../flink/table/calcite/FlinkTypeSystem.scala   |   51 +
 .../flink/table/codegen/CodeGenException.scala  |   24 +
 .../flink/table/codegen/CodeGenUtils.scala      |  292 ++++
 .../flink/table/codegen/CodeGenerator.scala     | 1522 ++++++++++++++++++
 .../apache/flink/table/codegen/Compiler.scala   |   41 +
 .../flink/table/codegen/ExpressionReducer.scala |  120 ++
 .../apache/flink/table/codegen/Indenter.scala   |   54 +
 .../table/codegen/calls/BuiltInMethods.scala    |   39 +
 .../table/codegen/calls/CallGenerator.scala     |   74 +
 .../codegen/calls/CurrentTimePointCallGen.scala |   58 +
 .../table/codegen/calls/FloorCeilCallGen.scala  |   73 +
 .../table/codegen/calls/FunctionGenerator.scala |  369 +++++
 .../table/codegen/calls/MethodCallGen.scala     |   44 +
 .../codegen/calls/MultiTypeMethodCallGen.scala  |   44 +
 .../table/codegen/calls/NotCallGenerator.scala  |   37 +
 .../codegen/calls/ScalarFunctionCallGen.scala   |   95 ++
 .../table/codegen/calls/ScalarOperators.scala   | 1025 ++++++++++++
 .../codegen/calls/TableFunctionCallGen.scala    |   83 +
 .../flink/table/codegen/calls/TrimCallGen.scala |   52 +
 .../apache/flink/table/codegen/generated.scala  |   43 +
 .../apache/flink/table/codegen/package.scala    |   25 +
 .../table/examples/scala/StreamSQLExample.scala |   76 +
 .../examples/scala/StreamTableExample.scala     |   72 +
 .../table/examples/scala/TPCHQuery3Table.scala  |  180 +++
 .../table/examples/scala/WordCountSQL.scala     |   62 +
 .../table/examples/scala/WordCountTable.scala   |   62 +
 .../flink/table/expressions/Expression.scala    |   88 +
 .../table/expressions/ExpressionParser.scala    |  489 ++++++
 .../table/expressions/ExpressionUtils.scala     |  154 ++
 .../flink/table/expressions/InputTypeSpec.scala |   57 +
 .../flink/table/expressions/aggregations.scala  |  100 ++
 .../flink/table/expressions/arithmetic.scala    |  158 ++
 .../apache/flink/table/expressions/array.scala  |  146 ++
 .../apache/flink/table/expressions/call.scala   |  160 ++
 .../apache/flink/table/expressions/cast.scala   |   53 +
 .../flink/table/expressions/comparison.scala    |  160 ++
 .../flink/table/expressions/composite.scala     |  106 ++
 .../table/expressions/fieldExpression.scala     |  152 ++
 .../flink/table/expressions/literals.scala      |  120 ++
 .../apache/flink/table/expressions/logic.scala  |  107 ++
 .../table/expressions/mathExpressions.scala     |  129 ++
 .../flink/table/expressions/ordering.scala      |   54 +
 .../flink/table/expressions/package.scala       |   29 +
 .../table/expressions/stringExpressions.scala   |  279 ++++
 .../flink/table/expressions/symbols.scala       |  132 ++
 .../apache/flink/table/expressions/time.scala   |  377 +++++
 .../table/expressions/windowProperties.scala    |   58 +
 .../flink/table/functions/ScalarFunction.scala  |  100 ++
 .../flink/table/functions/TableFunction.scala   |  138 ++
 .../table/functions/UserDefinedFunction.scala   |   27 +
 .../table/functions/utils/MathFunctions.scala   |   29 +
 .../functions/utils/ScalarSqlFunction.scala     |  183 +++
 .../functions/utils/TableSqlFunction.scala      |  120 ++
 .../utils/UserDefinedFunctionUtils.scala        |  341 ++++
 .../flink/table/plan/ProjectionTranslator.scala |  263 +++
 .../org/apache/flink/table/plan/TreeNode.scala  |  115 ++
 .../flink/table/plan/cost/DataSetCost.scala     |  150 ++
 .../table/plan/cost/DataSetCostFactory.scala    |   47 +
 .../flink/table/plan/logical/LogicalNode.scala  |  162 ++
 .../table/plan/logical/LogicalWindow.scala      |   36 +
 .../flink/table/plan/logical/Resolvable.scala   |   43 +
 .../flink/table/plan/logical/groupWindows.scala |  258 +++
 .../flink/table/plan/logical/operators.scala    |  694 ++++++++
 .../logical/rel/LogicalWindowAggregate.scala    |  114 ++
 .../flink/table/plan/nodes/FlinkAggregate.scala |   69 +
 .../flink/table/plan/nodes/FlinkCalc.scala      |  172 ++
 .../flink/table/plan/nodes/FlinkCorrelate.scala |  163 ++
 .../flink/table/plan/nodes/FlinkRel.scala       |  103 ++
 .../table/plan/nodes/dataset/BatchScan.scala    |   97 ++
 .../nodes/dataset/BatchTableSourceScan.scala    |   72 +
 .../plan/nodes/dataset/DataSetAggregate.scala   |  167 ++
 .../table/plan/nodes/dataset/DataSetCalc.scala  |  136 ++
 .../plan/nodes/dataset/DataSetConvention.scala  |   47 +
 .../plan/nodes/dataset/DataSetCorrelate.scala   |  139 ++
 .../plan/nodes/dataset/DataSetIntersect.scala   |  133 ++
 .../table/plan/nodes/dataset/DataSetJoin.scala  |  229 +++
 .../table/plan/nodes/dataset/DataSetMinus.scala |  145 ++
 .../table/plan/nodes/dataset/DataSetRel.scala   |   71 +
 .../table/plan/nodes/dataset/DataSetScan.scala  |   64 +
 .../nodes/dataset/DataSetSingleRowJoin.scala    |  193 +++
 .../table/plan/nodes/dataset/DataSetSort.scala  |  194 +++
 .../table/plan/nodes/dataset/DataSetUnion.scala |  104 ++
 .../plan/nodes/dataset/DataSetValues.scala      |  111 ++
 .../nodes/datastream/DataStreamAggregate.scala  |  359 +++++
 .../plan/nodes/datastream/DataStreamCalc.scala  |  104 ++
 .../nodes/datastream/DataStreamConvention.scala |   47 +
 .../nodes/datastream/DataStreamCorrelate.scala  |  134 ++
 .../plan/nodes/datastream/DataStreamRel.scala   |   45 +
 .../plan/nodes/datastream/DataStreamScan.scala  |   64 +
 .../plan/nodes/datastream/DataStreamUnion.scala |   75 +
 .../nodes/datastream/DataStreamValues.scala     |   97 ++
 .../plan/nodes/datastream/StreamScan.scala      |  107 ++
 .../datastream/StreamTableSourceScan.scala      |   63 +
 .../rules/EnumerableToLogicalTableScan.scala    |   49 +
 .../flink/table/plan/rules/FlinkRuleSets.scala  |  161 ++
 .../dataSet/BatchTableSourceScanRule.scala      |   73 +
 .../rules/dataSet/DataSetAggregateRule.scala    |   80 +
 .../DataSetAggregateWithNullValuesRule.scala    |   97 ++
 .../plan/rules/dataSet/DataSetCalcRule.scala    |   52 +
 .../rules/dataSet/DataSetCorrelateRule.scala    |   91 ++
 .../rules/dataSet/DataSetIntersectRule.scala    |   54 +
 .../plan/rules/dataSet/DataSetJoinRule.scala    |   73 +
 .../plan/rules/dataSet/DataSetMinusRule.scala   |   56 +
 .../plan/rules/dataSet/DataSetScanRule.scala    |   66 +
 .../dataSet/DataSetSingleRowJoinRule.scala      |   82 +
 .../plan/rules/dataSet/DataSetSortRule.scala    |   54 +
 .../plan/rules/dataSet/DataSetUnionRule.scala   |   64 +
 .../plan/rules/dataSet/DataSetValuesRule.scala  |   51 +
 ...ushProjectIntoBatchTableSourceScanRule.scala |   84 +
 .../datastream/DataStreamAggregateRule.scala    |   78 +
 .../rules/datastream/DataStreamCalcRule.scala   |   53 +
 .../datastream/DataStreamCorrelateRule.scala    |   92 ++
 .../rules/datastream/DataStreamScanRule.scala   |   64 +
 .../rules/datastream/DataStreamUnionRule.scala  |   53 +
 .../rules/datastream/DataStreamValuesRule.scala |   51 +
 .../datastream/StreamTableSourceScanRule.scala  |   76 +
 .../rules/util/RexProgramProjectExtractor.scala |  120 ++
 .../table/plan/schema/ArrayRelDataType.scala    |   53 +
 .../plan/schema/CompositeRelDataType.scala      |   83 +
 .../flink/table/plan/schema/DataSetTable.scala  |   51 +
 .../table/plan/schema/DataStreamTable.scala     |   28 +
 .../flink/table/plan/schema/FlinkTable.scala    |   67 +
 .../plan/schema/FlinkTableFunctionImpl.scala    |   85 +
 .../table/plan/schema/GenericRelDataType.scala  |   53 +
 .../flink/table/plan/schema/RelTable.scala      |   46 +
 .../table/plan/schema/TableSourceTable.scala    |   30 +
 .../table/runtime/CountPartitionFunction.scala  |   40 +
 .../flink/table/runtime/FlatJoinRunner.scala    |   52 +
 .../flink/table/runtime/FlatMapRunner.scala     |   52 +
 .../runtime/IntersectCoGroupFunction.scala      |   42 +
 .../table/runtime/LimitFilterFunction.scala     |   64 +
 .../flink/table/runtime/MapJoinLeftRunner.scala |   33 +
 .../table/runtime/MapJoinRightRunner.scala      |   33 +
 .../apache/flink/table/runtime/MapRunner.scala  |   51 +
 .../flink/table/runtime/MapSideJoinRunner.scala |   51 +
 .../table/runtime/MinusCoGroupFunction.scala    |   47 +
 .../table/runtime/aggregate/Aggregate.scala     |   96 ++
 .../AggregateAllTimeWindowFunction.scala        |   51 +
 .../aggregate/AggregateAllWindowFunction.scala  |   41 +
 .../aggregate/AggregateMapFunction.scala        |   62 +
 .../AggregateReduceCombineFunction.scala        |   80 +
 .../AggregateReduceGroupFunction.scala          |   92 ++
 .../aggregate/AggregateTimeWindowFunction.scala |   56 +
 .../table/runtime/aggregate/AggregateUtil.scala |  595 +++++++
 .../aggregate/AggregateWindowFunction.scala     |   46 +
 .../table/runtime/aggregate/AvgAggregate.scala  |  296 ++++
 .../runtime/aggregate/CountAggregate.scala      |   55 +
 ...rementalAggregateAllTimeWindowFunction.scala |   68 +
 .../IncrementalAggregateAllWindowFunction.scala |   79 +
 .../IncrementalAggregateReduceFunction.scala    |   63 +
 ...IncrementalAggregateTimeWindowFunction.scala |   69 +
 .../IncrementalAggregateWindowFunction.scala    |   81 +
 .../table/runtime/aggregate/MaxAggregate.scala  |  171 ++
 .../table/runtime/aggregate/MinAggregate.scala  |  171 ++
 .../table/runtime/aggregate/SumAggregate.scala  |  131 ++
 .../aggregate/TimeWindowPropertyCollector.scala |   54 +
 .../table/runtime/io/ValuesInputFormat.scala    |   53 +
 .../flink/table/sinks/BatchTableSink.scala      |   32 +
 .../apache/flink/table/sinks/CsvTableSink.scala |   86 +
 .../flink/table/sinks/StreamTableSink.scala     |   32 +
 .../apache/flink/table/sinks/TableSink.scala    |   59 +
 .../flink/table/sinks/TableSinkBase.scala       |   68 +
 .../flink/table/sources/BatchTableSource.scala  |   36 +
 .../flink/table/sources/CsvTableSource.scala    |  123 ++
 .../table/sources/ProjectableTableSource.scala  |   38 +
 .../flink/table/sources/StreamTableSource.scala |   37 +
 .../flink/table/sources/TableSource.scala       |   41 +
 .../table/typeutils/InternalTypeInfo.scala      |   81 +
 .../table/typeutils/RowIntervalTypeInfo.scala   |   36 +
 .../table/typeutils/TimeIntervalTypeInfo.scala  |  113 ++
 .../flink/table/typeutils/TypeCheckUtils.scala  |   94 ++
 .../flink/table/typeutils/TypeCoercion.scala    |  121 ++
 .../flink/table/typeutils/TypeConverter.scala   |  156 ++
 .../flink/table/validate/FunctionCatalog.scala  |  320 ++++
 .../flink/table/validate/ValidationResult.scala |   53 +
 .../flink/api/java/batch/ExplainTest.java       |  160 --
 .../api/java/batch/TableEnvironmentITCase.java  |  631 --------
 .../flink/api/java/batch/TableSourceITCase.java |  119 --
 .../flink/api/java/batch/sql/SqlITCase.java     |  141 --
 .../java/batch/table/AggregationsITCase.java    |  380 -----
 .../flink/api/java/batch/table/CalcITCase.java  |  324 ----
 .../api/java/batch/table/CastingITCase.java     |  140 --
 .../flink/api/java/batch/table/JoinITCase.java  |  207 ---
 .../flink/api/java/stream/sql/SqlITCase.java    |  121 --
 .../api/java/stream/utils/StreamTestData.java   |   64 -
 .../flink/table/api/java/batch/ExplainTest.java |  160 ++
 .../api/java/batch/TableEnvironmentITCase.java  |  630 ++++++++
 .../table/api/java/batch/TableSourceITCase.java |  119 ++
 .../table/api/java/batch/sql/SqlITCase.java     |  141 ++
 .../java/batch/table/AggregationsITCase.java    |  380 +++++
 .../table/api/java/batch/table/CalcITCase.java  |  324 ++++
 .../api/java/batch/table/CastingITCase.java     |  140 ++
 .../table/api/java/batch/table/JoinITCase.java  |  207 +++
 .../table/api/java/stream/sql/SqlITCase.java    |  121 ++
 .../api/java/stream/utils/StreamTestData.java   |   64 +
 .../flink/api/scala/batch/ExplainTest.scala     |  122 --
 .../batch/ProjectableTableSourceITCase.scala    |  146 --
 .../scala/batch/TableEnvironmentITCase.scala    |  273 ----
 .../flink/api/scala/batch/TableSinkITCase.scala |   71 -
 .../api/scala/batch/TableSourceITCase.scala     |  176 --
 .../scala/batch/sql/AggregationsITCase.scala    |  301 ----
 .../flink/api/scala/batch/sql/CalcITCase.scala  |  329 ----
 .../flink/api/scala/batch/sql/JoinITCase.scala  |  366 -----
 .../scala/batch/sql/SetOperatorsITCase.scala    |  266 ---
 .../api/scala/batch/sql/SetOperatorsTest.scala  |   83 -
 .../api/scala/batch/sql/SingleRowJoinTest.scala |  152 --
 .../flink/api/scala/batch/sql/SortITCase.scala  |  153 --
 .../scala/batch/sql/TableWithSQLITCase.scala    |  118 --
 .../sql/UserDefinedTableFunctionTest.scala      |  238 ---
 .../scala/batch/table/AggregationsITCase.scala  |  405 -----
 .../api/scala/batch/table/CalcITCase.scala      |  438 -----
 .../api/scala/batch/table/JoinITCase.scala      |  383 -----
 .../scala/batch/table/SetOperatorsITCase.scala  |  320 ----
 .../api/scala/batch/table/SortITCase.scala      |  186 ---
 .../table/UserDefinedTableFunctionTest.scala    |  180 ---
 .../api/scala/batch/utils/SortTestUtils.scala   |   58 -
 .../batch/utils/TableProgramsTestBase.scala     |   60 -
 .../api/scala/stream/ExplainStreamTest.scala    |   74 -
 .../api/scala/stream/TableSinkITCase.scala      |   64 -
 .../api/scala/stream/TableSourceITCase.scala    |  193 ---
 .../flink/api/scala/stream/sql/SqlITCase.scala  |  174 --
 .../sql/UserDefinedTableFunctionTest.scala      |  237 ---
 .../scala/stream/table/AggregationsITCase.scala |  199 ---
 .../api/scala/stream/table/CalcITCase.scala     |  286 ----
 .../scala/stream/table/GroupWindowTest.scala    |  734 ---------
 .../api/scala/stream/table/UnionITCase.scala    |  125 --
 .../scala/stream/table/UnsupportedOpsTest.scala |  112 --
 .../table/UserDefinedTableFunctionTest.scala    |  385 -----
 .../api/scala/stream/utils/StreamITCase.scala   |   49 -
 .../api/scala/stream/utils/StreamTestData.scala |   83 -
 .../flink/api/table/AggregationTest.scala       |  261 ---
 .../api/table/CalciteConfigBuilderTest.scala    |  208 ---
 .../api/table/CompositeFlatteningTest.scala     |  146 --
 .../api/table/ExpressionReductionTest.scala     |  424 -----
 .../flink/api/table/TableEnvironmentTest.scala  |  292 ----
 .../api/table/expressions/ArrayTypeTest.scala   |  360 -----
 .../table/expressions/CompositeAccessTest.scala |  193 ---
 .../api/table/expressions/DecimalTypeTest.scala |  311 ----
 .../expressions/NonDeterministicTests.scala     |   89 -
 .../table/expressions/ScalarFunctionsTest.scala | 1166 --------------
 .../table/expressions/ScalarOperatorsTest.scala |  220 ---
 .../table/expressions/SqlExpressionTest.scala   |  170 --
 .../table/expressions/TemporalTypesTest.scala   |  573 -------
 .../UserDefinedScalarFunctionTest.scala         |  228 ---
 .../expressions/utils/ExpressionTestBase.scala  |  217 ---
 .../utils/UserDefinedScalarFunctions.scala      |  121 --
 .../api/table/plan/FieldProjectionTest.scala    |  317 ----
 .../util/RexProgramProjectExtractorTest.scala   |  120 --
 .../runtime/aggregate/AggregateTestBase.scala   |  110 --
 .../runtime/aggregate/AvgAggregateTest.scala    |  154 --
 .../runtime/aggregate/CountAggregateTest.scala  |   31 -
 .../runtime/aggregate/MaxAggregateTest.scala    |  177 --
 .../runtime/aggregate/MinAggregateTest.scala    |  177 --
 .../runtime/aggregate/SumAggregateTest.scala    |  137 --
 .../dataset/DataSetCorrelateITCase.scala        |  178 --
 .../datastream/DataStreamCorrelateITCase.scala  |   91 --
 .../flink/api/table/utils/TableTestBase.scala   |  229 ---
 .../table/utils/UserDefinedTableFunctions.scala |  117 --
 .../apache/flink/table/AggregationTest.scala    |  261 +++
 .../flink/table/CalciteConfigBuilderTest.scala  |  209 +++
 .../flink/table/CompositeFlatteningTest.scala   |  147 ++
 .../flink/table/ExpressionReductionTest.scala   |  425 +++++
 .../flink/table/TableEnvironmentTest.scala      |  293 ++++
 .../table/api/scala/batch/ExplainTest.scala     |  122 ++
 .../batch/ProjectableTableSourceITCase.scala    |  146 ++
 .../scala/batch/TableEnvironmentITCase.scala    |  273 ++++
 .../table/api/scala/batch/TableSinkITCase.scala |   71 +
 .../api/scala/batch/TableSourceITCase.scala     |  176 ++
 .../scala/batch/sql/AggregationsITCase.scala    |  301 ++++
 .../table/api/scala/batch/sql/CalcITCase.scala  |  329 ++++
 .../table/api/scala/batch/sql/JoinITCase.scala  |  366 +++++
 .../scala/batch/sql/SetOperatorsITCase.scala    |  266 +++
 .../api/scala/batch/sql/SetOperatorsTest.scala  |   83 +
 .../api/scala/batch/sql/SingleRowJoinTest.scala |  152 ++
 .../table/api/scala/batch/sql/SortITCase.scala  |  153 ++
 .../scala/batch/sql/TableWithSQLITCase.scala    |  118 ++
 .../sql/UserDefinedTableFunctionTest.scala      |  238 +++
 .../scala/batch/table/AggregationsITCase.scala  |  405 +++++
 .../api/scala/batch/table/CalcITCase.scala      |  438 +++++
 .../scala/batch/table/FieldProjectionTest.scala |  318 ++++
 .../api/scala/batch/table/JoinITCase.scala      |  383 +++++
 .../scala/batch/table/SetOperatorsITCase.scala  |  320 ++++
 .../api/scala/batch/table/SortITCase.scala      |  186 +++
 .../table/UserDefinedTableFunctionTest.scala    |  179 ++
 .../api/scala/batch/utils/SortTestUtils.scala   |   58 +
 .../batch/utils/TableProgramsTestBase.scala     |   60 +
 .../api/scala/stream/ExplainStreamTest.scala    |   74 +
 .../api/scala/stream/TableSinkITCase.scala      |   63 +
 .../api/scala/stream/TableSourceITCase.scala    |  193 +++
 .../table/api/scala/stream/sql/SqlITCase.scala  |  174 ++
 .../sql/UserDefinedTableFunctionTest.scala      |  237 +++
 .../scala/stream/table/AggregationsITCase.scala |  199 +++
 .../api/scala/stream/table/CalcITCase.scala     |  286 ++++
 .../scala/stream/table/GroupWindowTest.scala    |  735 +++++++++
 .../api/scala/stream/table/UnionITCase.scala    |  125 ++
 .../scala/stream/table/UnsupportedOpsTest.scala |  112 ++
 .../table/UserDefinedTableFunctionTest.scala    |  385 +++++
 .../api/scala/stream/utils/StreamITCase.scala   |   51 +
 .../api/scala/stream/utils/StreamTestData.scala |   83 +
 .../flink/table/expressions/ArrayTypeTest.scala |  360 +++++
 .../table/expressions/CompositeAccessTest.scala |  193 +++
 .../table/expressions/DecimalTypeTest.scala     |  311 ++++
 .../expressions/NonDeterministicTests.scala     |   89 +
 .../table/expressions/ScalarFunctionsTest.scala | 1166 ++++++++++++++
 .../table/expressions/ScalarOperatorsTest.scala |  220 +++
 .../table/expressions/SqlExpressionTest.scala   |  170 ++
 .../table/expressions/TemporalTypesTest.scala   |  573 +++++++
 .../UserDefinedScalarFunctionTest.scala         |  228 +++
 .../expressions/utils/ExpressionTestBase.scala  |  218 +++
 .../utils/UserDefinedScalarFunctions.scala      |  121 ++
 .../util/RexProgramProjectExtractorTest.scala   |  121 ++
 .../runtime/aggregate/AggregateTestBase.scala   |  111 ++
 .../runtime/aggregate/AvgAggregateTest.scala    |  154 ++
 .../runtime/aggregate/CountAggregateTest.scala  |   31 +
 .../runtime/aggregate/MaxAggregateTest.scala    |  177 ++
 .../runtime/aggregate/MinAggregateTest.scala    |  177 ++
 .../runtime/aggregate/SumAggregateTest.scala    |  137 ++
 .../dataset/DataSetCorrelateITCase.scala        |  177 ++
 .../datastream/DataStreamCorrelateITCase.scala  |   91 ++
 .../flink/table/utils/TableTestBase.scala       |  229 +++
 .../table/utils/UserDefinedTableFunctions.scala |  117 ++
 566 files changed, 43213 insertions(+), 43174 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/ffe9ec8e/docs/dev/table_api.md
----------------------------------------------------------------------
diff --git a/docs/dev/table_api.md b/docs/dev/table_api.md
index d14b37a..d851c4c 100644
--- a/docs/dev/table_api.md
+++ b/docs/dev/table_api.md
@@ -398,7 +398,7 @@ Please refer to the Javadoc for a full list of supported operations and a descri
 </div>
 
 <div data-lang="scala" markdown="1">
-The Table API is enabled by importing `org.apache.flink.api.scala.table._`. This enables
+The Table API is enabled by importing `org.apache.flink.table.api.scala._`. This enables
 implicit conversions to convert a `DataSet` or `DataStream` to a Table. The following example shows:
 
 - how a `DataSet` is converted to a `Table`,
@@ -407,7 +407,7 @@ implicit conversions to convert a `DataSet` or `DataStream` to a Table. The foll
 
 {% highlight scala %}
 import org.apache.flink.api.scala._
-import org.apache.flink.api.scala.table._
+import org.apache.flink.table.api.scala._
 
 case class WC(word: String, count: Int)
 
@@ -448,7 +448,7 @@ The following example shows how to convert a `DataStream` to a `Table` and filte
 
 {% highlight scala %}
 import org.apache.flink.api.scala._
-import org.apache.flink.api.scala.table._
+import org.apache.flink.table.api.scala._
 
 val env = StreamExecutionEnvironment.getExecutionEnvironment
 val tEnv = TableEnvironment.getTableEnvironment(env)
@@ -479,7 +479,7 @@ A registered table can be accessed from a `TableEnvironment` as follows:
 ### Table API Operators
 
 The Table API features a domain-specific language to execute language-integrated queries on structured data in Scala and Java.
-This section gives a brief overview of the available operators. You can find more details of operators in the [Javadoc]({{site.baseurl}}/api/java/org/apache/flink/api/table/Table.html).
+This section gives a brief overview of the available operators. You can find more details of operators in the [Javadoc]({{site.baseurl}}/api/java/org/apache/flink/table/api/Table.html).
 
 <div class="codetabs" markdown="1">
 <div data-lang="java" markdown="1">
@@ -1451,7 +1451,7 @@ A, ABS, ABSOLUTE, ACTION, ADA, ADD, ADMIN, AFTER, ALL, ALLOCATE, ALLOW, ALTER, A
 Data Types
 ----------
 
-The Table API is built on top of Flink's DataSet and DataStream API. Internally, it also uses Flink's `TypeInformation` to distinguish between types. The Table API does not support all Flink types so far. All supported simple types are listed in `org.apache.flink.api.table.Types`. The following table summarizes the relation between Table API types, SQL types, and the resulting Java class.
+The Table API is built on top of Flink's DataSet and DataStream API. Internally, it also uses Flink's `TypeInformation` to distinguish between types. The Table API does not support all Flink types so far. All supported simple types are listed in `org.apache.flink.table.api.Types`. The following table summarizes the relation between Table API types, SQL types, and the resulting Java class.
 
 | Table API              | SQL                         | Java type              |
 | :--------------------- | :-------------------------- | :--------------------- |
@@ -3814,7 +3814,7 @@ ELEMENT(ARRAY)
 
 If a required scalar function is not contained in the built-in functions, it is possible to define custom, user-defined scalar functions for both the Table API and SQL. A user-defined scalar functions maps zero, one, or multiple scalar values to a new scalar value.
 
-In order to define a scalar function one has to extend the base class `ScalarFunction` in `org.apache.flink.api.table.functions` and implement (one or more) evaluation methods. The behavior of a scalar function is determined by the evaluation method. An evaluation method must be declared publicly and named `eval`. The parameter types and return type of the evaluation method also determine the parameter and return types of the scalar function. Evaluation methods can also be overloaded by implementing multiple methods named `eval`.
+In order to define a scalar function one has to extend the base class `ScalarFunction` in `org.apache.flink.table.functions` and implement (one or more) evaluation methods. The behavior of a scalar function is determined by the evaluation method. An evaluation method must be declared publicly and named `eval`. The parameter types and return type of the evaluation method also determine the parameter and return types of the scalar function. Evaluation methods can also be overloaded by implementing multiple methods named `eval`.
 
 The following example snippet shows how to define your own hash code function:
 
@@ -3901,7 +3901,7 @@ object TimestampModifier extends ScalarFunction {
 
 A user-defined table function is implemented similar to a user-defined scalar function but can return a set of values instead of a single value. The returned set of values can consist of multiple columns and multiple rows similar to a standard table. A user-defined table function works on zero, one, or multiple scalar values as input and returns multiple rows as output.
 
-In order to define a table function one has to extend the base class `TableFunction` in `org.apache.flink.api.table.functions` and implement (one or more) evaluation methods. The behavior of a table function is determined by its evaluation methods. An evaluation method must be declared `public` and named `eval`. The `TableFunction` can be overloaded by implementing multiple methods named `eval`. The parameter types of the evaluation methods determine all valid parameters of the table function. The type of the returned table is determined by the generic type of `TableFunction`. Evaluation methods emit output rows using the protected `collect(T)` method.
+In order to define a table function one has to extend the base class `TableFunction` in `org.apache.flink.table.functions` and implement (one or more) evaluation methods. The behavior of a table function is determined by its evaluation methods. An evaluation method must be declared `public` and named `eval`. The `TableFunction` can be overloaded by implementing multiple methods named `eval`. The parameter types of the evaluation methods determine all valid parameters of the table function. The type of the returned table is determined by the generic type of `TableFunction`. Evaluation methods emit output rows using the protected `collect(T)` method.
 
 In the Table API, a table function is used with `.join(Expression)` or `.leftOuterJoin(Expression)` for Scala users and `.join(String)` or `.leftOuterJoin(String)` for Java users. The `join` operator (cross) joins each row from the outer table (table on the left of the operator) with all rows produced by the table-valued function (which is on the right side of the operator). The `leftOuterJoin` operator joins each row from the outer table (table on the left of the operator) with all rows produced by the table-valued function (which is on the right side of the operator) and preserves outer rows for which the table function returns an empty table. In SQL use `LATERAL TABLE(<TableFunction>)` with CROSS JOIN and LEFT JOIN with ON TRUE condition (see examples below).
 

http://git-wip-us.apache.org/repos/asf/flink/blob/ffe9ec8e/flink-connectors/flink-connector-kafka-0.10/src/main/java/org/apache/flink/streaming/connectors/kafka/Kafka010JsonTableSource.java
----------------------------------------------------------------------
diff --git a/flink-connectors/flink-connector-kafka-0.10/src/main/java/org/apache/flink/streaming/connectors/kafka/Kafka010JsonTableSource.java b/flink-connectors/flink-connector-kafka-0.10/src/main/java/org/apache/flink/streaming/connectors/kafka/Kafka010JsonTableSource.java
index 920d718..bfae1a9 100644
--- a/flink-connectors/flink-connector-kafka-0.10/src/main/java/org/apache/flink/streaming/connectors/kafka/Kafka010JsonTableSource.java
+++ b/flink-connectors/flink-connector-kafka-0.10/src/main/java/org/apache/flink/streaming/connectors/kafka/Kafka010JsonTableSource.java
@@ -20,7 +20,7 @@ package org.apache.flink.streaming.connectors.kafka;
 
 import org.apache.flink.api.common.typeinfo.TypeInformation;
 import org.apache.flink.types.Row;
-import org.apache.flink.api.table.sources.StreamTableSource;
+import org.apache.flink.table.sources.StreamTableSource;
 import org.apache.flink.streaming.util.serialization.DeserializationSchema;
 
 import java.util.Properties;

http://git-wip-us.apache.org/repos/asf/flink/blob/ffe9ec8e/flink-connectors/flink-connector-kafka-0.10/src/main/java/org/apache/flink/streaming/connectors/kafka/Kafka010TableSource.java
----------------------------------------------------------------------
diff --git a/flink-connectors/flink-connector-kafka-0.10/src/main/java/org/apache/flink/streaming/connectors/kafka/Kafka010TableSource.java b/flink-connectors/flink-connector-kafka-0.10/src/main/java/org/apache/flink/streaming/connectors/kafka/Kafka010TableSource.java
index 127dafc..e5254c0 100644
--- a/flink-connectors/flink-connector-kafka-0.10/src/main/java/org/apache/flink/streaming/connectors/kafka/Kafka010TableSource.java
+++ b/flink-connectors/flink-connector-kafka-0.10/src/main/java/org/apache/flink/streaming/connectors/kafka/Kafka010TableSource.java
@@ -20,7 +20,7 @@ package org.apache.flink.streaming.connectors.kafka;
 
 import org.apache.flink.api.common.typeinfo.TypeInformation;
 import org.apache.flink.types.Row;
-import org.apache.flink.api.table.sources.StreamTableSource;
+import org.apache.flink.table.sources.StreamTableSource;
 import org.apache.flink.streaming.util.serialization.DeserializationSchema;
 
 import java.util.Properties;

http://git-wip-us.apache.org/repos/asf/flink/blob/ffe9ec8e/flink-connectors/flink-connector-kafka-0.8/src/main/java/org/apache/flink/streaming/connectors/kafka/Kafka08JsonTableSource.java
----------------------------------------------------------------------
diff --git a/flink-connectors/flink-connector-kafka-0.8/src/main/java/org/apache/flink/streaming/connectors/kafka/Kafka08JsonTableSource.java b/flink-connectors/flink-connector-kafka-0.8/src/main/java/org/apache/flink/streaming/connectors/kafka/Kafka08JsonTableSource.java
index 6c7d727..27e7e6e 100644
--- a/flink-connectors/flink-connector-kafka-0.8/src/main/java/org/apache/flink/streaming/connectors/kafka/Kafka08JsonTableSource.java
+++ b/flink-connectors/flink-connector-kafka-0.8/src/main/java/org/apache/flink/streaming/connectors/kafka/Kafka08JsonTableSource.java
@@ -20,7 +20,7 @@ package org.apache.flink.streaming.connectors.kafka;
 
 import org.apache.flink.api.common.typeinfo.TypeInformation;
 import org.apache.flink.types.Row;
-import org.apache.flink.api.table.sources.StreamTableSource;
+import org.apache.flink.table.sources.StreamTableSource;
 import org.apache.flink.streaming.util.serialization.DeserializationSchema;
 
 import java.util.Properties;

http://git-wip-us.apache.org/repos/asf/flink/blob/ffe9ec8e/flink-connectors/flink-connector-kafka-0.8/src/main/java/org/apache/flink/streaming/connectors/kafka/Kafka08TableSource.java
----------------------------------------------------------------------
diff --git a/flink-connectors/flink-connector-kafka-0.8/src/main/java/org/apache/flink/streaming/connectors/kafka/Kafka08TableSource.java b/flink-connectors/flink-connector-kafka-0.8/src/main/java/org/apache/flink/streaming/connectors/kafka/Kafka08TableSource.java
index 0e3791c..19fd50d 100644
--- a/flink-connectors/flink-connector-kafka-0.8/src/main/java/org/apache/flink/streaming/connectors/kafka/Kafka08TableSource.java
+++ b/flink-connectors/flink-connector-kafka-0.8/src/main/java/org/apache/flink/streaming/connectors/kafka/Kafka08TableSource.java
@@ -20,7 +20,7 @@ package org.apache.flink.streaming.connectors.kafka;
 
 import org.apache.flink.api.common.typeinfo.TypeInformation;
 import org.apache.flink.types.Row;
-import org.apache.flink.api.table.sources.StreamTableSource;
+import org.apache.flink.table.sources.StreamTableSource;
 import org.apache.flink.streaming.util.serialization.DeserializationSchema;
 
 import java.util.Properties;

http://git-wip-us.apache.org/repos/asf/flink/blob/ffe9ec8e/flink-connectors/flink-connector-kafka-0.9/src/main/java/org/apache/flink/streaming/connectors/kafka/Kafka09JsonTableSource.java
----------------------------------------------------------------------
diff --git a/flink-connectors/flink-connector-kafka-0.9/src/main/java/org/apache/flink/streaming/connectors/kafka/Kafka09JsonTableSource.java b/flink-connectors/flink-connector-kafka-0.9/src/main/java/org/apache/flink/streaming/connectors/kafka/Kafka09JsonTableSource.java
index dfcba5f..5be09fb 100644
--- a/flink-connectors/flink-connector-kafka-0.9/src/main/java/org/apache/flink/streaming/connectors/kafka/Kafka09JsonTableSource.java
+++ b/flink-connectors/flink-connector-kafka-0.9/src/main/java/org/apache/flink/streaming/connectors/kafka/Kafka09JsonTableSource.java
@@ -20,7 +20,7 @@ package org.apache.flink.streaming.connectors.kafka;
 
 import org.apache.flink.api.common.typeinfo.TypeInformation;
 import org.apache.flink.types.Row;
-import org.apache.flink.api.table.sources.StreamTableSource;
+import org.apache.flink.table.sources.StreamTableSource;
 import org.apache.flink.streaming.util.serialization.DeserializationSchema;
 
 import java.util.Properties;

http://git-wip-us.apache.org/repos/asf/flink/blob/ffe9ec8e/flink-connectors/flink-connector-kafka-0.9/src/main/java/org/apache/flink/streaming/connectors/kafka/Kafka09TableSource.java
----------------------------------------------------------------------
diff --git a/flink-connectors/flink-connector-kafka-0.9/src/main/java/org/apache/flink/streaming/connectors/kafka/Kafka09TableSource.java b/flink-connectors/flink-connector-kafka-0.9/src/main/java/org/apache/flink/streaming/connectors/kafka/Kafka09TableSource.java
index f423003..e226074 100644
--- a/flink-connectors/flink-connector-kafka-0.9/src/main/java/org/apache/flink/streaming/connectors/kafka/Kafka09TableSource.java
+++ b/flink-connectors/flink-connector-kafka-0.9/src/main/java/org/apache/flink/streaming/connectors/kafka/Kafka09TableSource.java
@@ -20,7 +20,7 @@ package org.apache.flink.streaming.connectors.kafka;
 
 import org.apache.flink.api.common.typeinfo.TypeInformation;
 import org.apache.flink.types.Row;
-import org.apache.flink.api.table.sources.StreamTableSource;
+import org.apache.flink.table.sources.StreamTableSource;
 import org.apache.flink.streaming.util.serialization.DeserializationSchema;
 
 import java.util.Properties;

http://git-wip-us.apache.org/repos/asf/flink/blob/ffe9ec8e/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/KafkaJsonTableSource.java
----------------------------------------------------------------------
diff --git a/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/KafkaJsonTableSource.java b/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/KafkaJsonTableSource.java
index f145509..3cdad0f 100644
--- a/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/KafkaJsonTableSource.java
+++ b/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/KafkaJsonTableSource.java
@@ -19,7 +19,7 @@
 package org.apache.flink.streaming.connectors.kafka;
 
 import org.apache.flink.api.common.typeinfo.TypeInformation;
-import org.apache.flink.api.table.sources.StreamTableSource;
+import org.apache.flink.table.sources.StreamTableSource;
 import org.apache.flink.streaming.util.serialization.DeserializationSchema;
 import org.apache.flink.streaming.util.serialization.JsonRowDeserializationSchema;
 

http://git-wip-us.apache.org/repos/asf/flink/blob/ffe9ec8e/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/KafkaTableSink.java
----------------------------------------------------------------------
diff --git a/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/KafkaTableSink.java b/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/KafkaTableSink.java
index 6c42943..97f5fba 100644
--- a/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/KafkaTableSink.java
+++ b/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/KafkaTableSink.java
@@ -19,8 +19,8 @@ package org.apache.flink.streaming.connectors.kafka;
 
 import org.apache.flink.api.common.typeinfo.TypeInformation;
 import org.apache.flink.types.Row;
-import org.apache.flink.api.table.sinks.StreamTableSink;
 import org.apache.flink.api.java.typeutils.RowTypeInfo;
+import org.apache.flink.table.sinks.StreamTableSink;
 import org.apache.flink.streaming.api.datastream.DataStream;
 import org.apache.flink.streaming.connectors.kafka.partitioner.KafkaPartitioner;
 import org.apache.flink.streaming.util.serialization.SerializationSchema;

http://git-wip-us.apache.org/repos/asf/flink/blob/ffe9ec8e/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/KafkaTableSource.java
----------------------------------------------------------------------
diff --git a/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/KafkaTableSource.java b/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/KafkaTableSource.java
index 498e918..9a9c85d 100644
--- a/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/KafkaTableSource.java
+++ b/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/KafkaTableSource.java
@@ -20,8 +20,8 @@ package org.apache.flink.streaming.connectors.kafka;
 
 import org.apache.flink.api.common.typeinfo.TypeInformation;
 import org.apache.flink.types.Row;
-import org.apache.flink.api.table.sources.StreamTableSource;
 import org.apache.flink.api.java.typeutils.RowTypeInfo;
+import org.apache.flink.table.sources.StreamTableSource;
 import org.apache.flink.streaming.api.datastream.DataStream;
 import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
 import org.apache.flink.streaming.util.serialization.DeserializationSchema;

http://git-wip-us.apache.org/repos/asf/flink/blob/ffe9ec8e/flink-libraries/flink-table/src/main/java/org/apache/flink/api/java/table/package-info.java
----------------------------------------------------------------------
diff --git a/flink-libraries/flink-table/src/main/java/org/apache/flink/api/java/table/package-info.java b/flink-libraries/flink-table/src/main/java/org/apache/flink/api/java/table/package-info.java
deleted file mode 100644
index 1db4cb8..0000000
--- a/flink-libraries/flink-table/src/main/java/org/apache/flink/api/java/table/package-info.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * <strong>Table API (Java)</strong><br>
- *
- * A {@link org.apache.flink.api.java.table.BatchTableEnvironment} can be used to create a
- * {@link org.apache.flink.api.table.Table} from a {@link org.apache.flink.api.java.DataSet}.
- * Equivalently, a {@link org.apache.flink.api.java.table.StreamTableEnvironment} can be used to
- * create a {@link org.apache.flink.api.table.Table} from a
- * {@link org.apache.flink.streaming.api.datastream.DataStream}.
- *
- * <p>
- * Tables can be used to perform SQL-like queries on data. Please have
- * a look at {@link org.apache.flink.api.table.Table} to see which operations are supported and
- * how query strings are written.
- *
- * <p>
- * Example:
- *
- * <pre>{@code
- * ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
- * BatchTableEnvironment tEnv = TableEnvironment.getTableEnvironment(env);
- *
- * DataSet<WC> input = env.fromElements(
- *   new WC("Hello", 1),
- *   new WC("Ciao", 1),
- *   new WC("Hello", 1));
- *
- * Table table = tEnv.fromDataSet(input);
- *
- * Table filtered = table
- *     .groupBy("word")
- *     .select("word.count as count, word")
- *     .filter("count = 2");
- *
- * DataSet<WC> result = tEnv.toDataSet(filtered, WC.class);
- *
- * result.print();
- * }</pre>
- *
- * <p>
- * As seen above, a {@link org.apache.flink.api.table.Table} can be converted back to the
- * underlying API representation using
- * {@link org.apache.flink.api.java.table.BatchTableEnvironment#toDataSet(org.apache.flink.api.table.Table, java.lang.Class)}
- * or {@link org.apache.flink.api.java.table.StreamTableEnvironment#toDataStream(org.apache.flink.api.table.Table, java.lang.Class)}}.
- */
-package org.apache.flink.api.java.table;

http://git-wip-us.apache.org/repos/asf/flink/blob/ffe9ec8e/flink-libraries/flink-table/src/main/java/org/apache/flink/api/table/explain/Node.java
----------------------------------------------------------------------
diff --git a/flink-libraries/flink-table/src/main/java/org/apache/flink/api/table/explain/Node.java b/flink-libraries/flink-table/src/main/java/org/apache/flink/api/table/explain/Node.java
deleted file mode 100644
index 9152260..0000000
--- a/flink-libraries/flink-table/src/main/java/org/apache/flink/api/table/explain/Node.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.flink.api.table.explain;
-
-import java.util.List;
-
-public class Node {
-	private int id;
-	private String type;
-	private String pact;
-	private String contents;
-	private int parallelism;
-	private String driver_strategy;
-	private List<Predecessors> predecessors;
-	private List<Global_properties> global_properties;
-	private List<LocalProperty> local_properties;
-	private List<Estimates> estimates;
-	private List<Costs> costs;
-	private List<Compiler_hints> compiler_hints;
-
-	public int getId() {
-		return id;
-	}
-	public String getType() {
-		return type;
-	}
-	public String getPact() {
-		return pact;
-	}
-	public String getContents() {
-		return contents;
-	}
-	public int getParallelism() {
-		return parallelism;
-	}
-	public String getDriver_strategy() {
-		return driver_strategy;
-	}
-	public List<Predecessors> getPredecessors() {
-		return predecessors;
-	}
-	public List<Global_properties> getGlobal_properties() {
-		return global_properties;
-	}
-	public List<LocalProperty> getLocal_properties() {
-		return local_properties;
-	}
-	public List<Estimates> getEstimates() {
-		return estimates;
-	}
-	public List<Costs> getCosts() {
-		return costs;
-	}
-	public List<Compiler_hints> getCompiler_hints() {
-		return compiler_hints;
-	}
-}
-
-class Predecessors {
-	private String ship_strategy;
-	private String exchange_mode;
-
-	public String getShip_strategy() {
-		return ship_strategy;
-	}
-	public String getExchange_mode() {
-		return exchange_mode;
-	}
-}
-
-class Global_properties {
-	private String name;
-	private String value;
-
-	public String getValue() {
-		return value;
-	}
-	public String getName() {
-		return name;
-	}
-}
-
-class LocalProperty {
-	private String name;
-	private String value;
-
-	public String getValue() {
-		return value;
-	}
-	public String getName() {
-		return name;
-	}
-}
-
-class Estimates {
-	private String name;
-	private String value;
-
-	public String getValue() {
-		return value;
-	}
-	public String getName() {
-		return name;
-	}
-}
-
-class Costs {
-	private String name;
-	private String value;
-
-	public String getValue() {
-		return value;
-	}
-	public String getName() {
-		return name;
-	}
-}
-
-class Compiler_hints {
-	private String name;
-	private String value;
-
-	public String getValue() {
-		return value;
-	}
-	public String getName() {
-		return name;
-	}
-}

http://git-wip-us.apache.org/repos/asf/flink/blob/ffe9ec8e/flink-libraries/flink-table/src/main/java/org/apache/flink/api/table/explain/PlanJsonParser.java
----------------------------------------------------------------------
diff --git a/flink-libraries/flink-table/src/main/java/org/apache/flink/api/table/explain/PlanJsonParser.java b/flink-libraries/flink-table/src/main/java/org/apache/flink/api/table/explain/PlanJsonParser.java
deleted file mode 100644
index bd14cd2..0000000
--- a/flink-libraries/flink-table/src/main/java/org/apache/flink/api/table/explain/PlanJsonParser.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.flink.api.table.explain;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.DeserializationFeature;
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.util.LinkedHashMap;
-import java.util.List;
-
-public class PlanJsonParser {
-
-	public static String getSqlExecutionPlan(String t, Boolean extended) throws Exception {
-		ObjectMapper objectMapper = new ObjectMapper();
-
-		//not every node is same, ignore the unknown field
-		objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
-
-		PlanTree tree = objectMapper.readValue(t, PlanTree.class);
-		LinkedHashMap<String, Integer> map = new LinkedHashMap<>();
-		StringWriter sw = new StringWriter();
-		PrintWriter pw = new PrintWriter(sw);
-		int tabCount = 0;
-
-		for (int index = 0; index < tree.getNodes().size(); index++) {
-			Node tempNode = tree.getNodes().get(index);
-
-			//input with operation such as join or union is coordinate, keep the same indent 
-			if ((tempNode.getPact().equals("Data Source")) && (map.containsKey(tempNode.getPact()))) {
-				tabCount = map.get(tempNode.getPact());
-			}
-			else {
-				map.put(tempNode.getPact(), tabCount);
-			}
-
-			printTab(tabCount, pw);
-			pw.print("Stage " + tempNode.getId() + " : " + tempNode.getPact() + "\n");
-
-			printTab(tabCount + 1, pw);
-			String content = tempNode.getContents();
-
-			//drop the hashcode of object instance
-			int dele = tempNode.getContents().indexOf("@");
-			if (dele > -1) {
-				content = tempNode.getContents().substring(0, dele);
-			}
-
-			//replace with certain content if node is dataSource to pass
-			//unit tests, because java and scala use different api to
-			//get input element
-			if (tempNode.getPact().equals("Data Source")) {
-				content = "collect elements with CollectionInputFormat";
-			}
-			pw.print("content : " + content + "\n");
-
-			List<Predecessors> predecessors = tempNode.getPredecessors();
-			if (predecessors != null) {
-				printTab(tabCount + 1, pw);
-				pw.print("ship_strategy : " + predecessors.get(0).getShip_strategy() + "\n");
-
-				String mode = predecessors.get(0).getExchange_mode();
-				if (mode != null) {
-					printTab(tabCount + 1, pw);
-					pw.print("exchange_mode : " + mode + "\n");
-				}
-			}
-
-			if (tempNode.getDriver_strategy() != null) {
-				printTab(tabCount + 1, pw);
-				pw.print("driver_strategy : " + tempNode.getDriver_strategy() + "\n");
-			}
-
-			if (tempNode.getGlobal_properties() != null) {
-				printTab(tabCount + 1, pw);
-				pw.print(tempNode.getGlobal_properties().get(0).getName() + " : "
-					+ tempNode.getGlobal_properties().get(0).getValue() + "\n");
-			}
-
-			if (extended) {
-				List<Global_properties> globalProperties = tempNode.getGlobal_properties();
-				for (int i = 1; i < globalProperties.size(); i++) {
-					printTab(tabCount + 1, pw);
-					pw.print(globalProperties.get(i).getName() + " : "
-					+ globalProperties.get(i).getValue() + "\n");
-				}
-
-				List<LocalProperty> localProperties = tempNode.getLocal_properties();
-				for (int i = 0; i < localProperties.size(); i++) {
-					printTab(tabCount + 1, pw);
-					pw.print(localProperties.get(i).getName() + " : "
-					+ localProperties.get(i).getValue() + "\n");
-				}
-
-				List<Estimates> estimates = tempNode.getEstimates();
-				for (int i = 0; i < estimates.size(); i++) {
-					printTab(tabCount + 1, pw);
-					pw.print(estimates.get(i).getName() + " : "
-					+ estimates.get(i).getValue() + "\n");
-				}
-
-				List<Costs> costs = tempNode.getCosts();
-				for (int i = 0; i < costs.size(); i++) {
-					printTab(tabCount + 1, pw);
-					pw.print(costs.get(i).getName() + " : "
-					+ costs.get(i).getValue() + "\n");
-				}
-
-				List<Compiler_hints> compilerHintses = tempNode.getCompiler_hints();
-				for (int i = 0; i < compilerHintses.size(); i++) {
-					printTab(tabCount + 1, pw);
-					pw.print(compilerHintses.get(i).getName() + " : "
-					+ compilerHintses.get(i).getValue() + "\n");
-				}
-			}
-			tabCount++;
-			pw.print("\n");
-		}
-		pw.close();
-		return sw.toString();
-	}
-
-	private static void printTab(int tabCount, PrintWriter pw) {
-		for (int i = 0; i < tabCount; i++)
-			pw.print("\t");
-	}
-}
-
-class PlanTree {
-	private List<Node> nodes;
-
-	public List<Node> getNodes() {
-		return nodes;
-	}
-}

http://git-wip-us.apache.org/repos/asf/flink/blob/ffe9ec8e/flink-libraries/flink-table/src/main/java/org/apache/flink/examples/java/WordCountSQL.java
----------------------------------------------------------------------
diff --git a/flink-libraries/flink-table/src/main/java/org/apache/flink/examples/java/WordCountSQL.java b/flink-libraries/flink-table/src/main/java/org/apache/flink/examples/java/WordCountSQL.java
deleted file mode 100644
index c9043d1..0000000
--- a/flink-libraries/flink-table/src/main/java/org/apache/flink/examples/java/WordCountSQL.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.flink.examples.java;
-
-import org.apache.flink.api.table.Table;
-import org.apache.flink.api.java.DataSet;
-import org.apache.flink.api.java.ExecutionEnvironment;
-import org.apache.flink.api.java.table.BatchTableEnvironment;
-import org.apache.flink.api.table.TableEnvironment;
-
-/**
- * Simple example that shows how the Batch SQL API is used in Java.
- *
- * This example shows how to:
- *  - Convert DataSets to Tables
- *  - Register a Table under a name
- *  - Run a SQL query on the registered Table
- *
- */
-public class WordCountSQL {
-
-	// *************************************************************************
-	//     PROGRAM
-	// *************************************************************************
-
-	public static void main(String[] args) throws Exception {
-
-		// set up execution environment
-		ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
-		BatchTableEnvironment tEnv = TableEnvironment.getTableEnvironment(env);
-
-		DataSet<WC> input = env.fromElements(
-			new WC("Hello", 1),
-			new WC("Ciao", 1),
-			new WC("Hello", 1));
-
-		// register the DataSet as table "WordCount"
-		tEnv.registerDataSet("WordCount", input, "word, frequency");
-
-		// run a SQL query on the Table and retrieve the result as a new Table
-		Table table = tEnv.sql(
-			"SELECT word, SUM(frequency) as frequency FROM WordCount GROUP BY word");
-
-		DataSet<WC> result = tEnv.toDataSet(table, WC.class);
-
-		result.print();
-	}
-
-	// *************************************************************************
-	//     USER DATA TYPES
-	// *************************************************************************
-
-	public static class WC {
-		public String word;
-		public long frequency;
-
-		// public constructor to make it a Flink POJO
-		public WC() {
-		}
-
-		public WC(String word, long frequency) {
-			this.word = word;
-			this.frequency = frequency;
-		}
-
-		@Override
-		public String toString() {
-			return "WC " + word + " " + frequency;
-		}
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/flink/blob/ffe9ec8e/flink-libraries/flink-table/src/main/java/org/apache/flink/examples/java/WordCountTable.java
----------------------------------------------------------------------
diff --git a/flink-libraries/flink-table/src/main/java/org/apache/flink/examples/java/WordCountTable.java b/flink-libraries/flink-table/src/main/java/org/apache/flink/examples/java/WordCountTable.java
deleted file mode 100644
index c339cf1..0000000
--- a/flink-libraries/flink-table/src/main/java/org/apache/flink/examples/java/WordCountTable.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.flink.examples.java;
-
-import org.apache.flink.api.table.Table;
-import org.apache.flink.api.java.DataSet;
-import org.apache.flink.api.java.ExecutionEnvironment;
-import org.apache.flink.api.java.table.BatchTableEnvironment;
-import org.apache.flink.api.table.TableEnvironment;
-
-/**
-  * Simple example for demonstrating the use of the Table API for a Word Count in Java.
-  *
-  * This example shows how to:
-  *  - Convert DataSets to Tables
-  *  - Apply group, aggregate, select, and filter operations
-  *
-  */
-public class WordCountTable {
-
-	// *************************************************************************
-	//     PROGRAM
-	// *************************************************************************
-
-	public static void main(String[] args) throws Exception {
-		ExecutionEnvironment env = ExecutionEnvironment.createCollectionsEnvironment();
-		BatchTableEnvironment tEnv = TableEnvironment.getTableEnvironment(env);
-
-		DataSet<WC> input = env.fromElements(
-				new WC("Hello", 1),
-				new WC("Ciao", 1),
-				new WC("Hello", 1));
-
-		Table table = tEnv.fromDataSet(input);
-
-		Table filtered = table
-				.groupBy("word")
-				.select("word, frequency.sum as frequency")
-				.filter("frequency = 2");
-
-		DataSet<WC> result = tEnv.toDataSet(filtered, WC.class);
-
-		result.print();
-	}
-
-	// *************************************************************************
-	//     USER DATA TYPES
-	// *************************************************************************
-
-	public static class WC {
-		public String word;
-		public long frequency;
-
-		// public constructor to make it a Flink POJO
-		public WC() {
-
-		}
-
-		public WC(String word, long frequency) {
-			this.word = word;
-			this.frequency = frequency;
-		}
-
-		@Override
-		public String toString() {
-			return "WC " + word + " " + frequency;
-		}
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/flink/blob/ffe9ec8e/flink-libraries/flink-table/src/main/java/org/apache/flink/table/api/java/package-info.java
----------------------------------------------------------------------
diff --git a/flink-libraries/flink-table/src/main/java/org/apache/flink/table/api/java/package-info.java b/flink-libraries/flink-table/src/main/java/org/apache/flink/table/api/java/package-info.java
new file mode 100644
index 0000000..2409872
--- /dev/null
+++ b/flink-libraries/flink-table/src/main/java/org/apache/flink/table/api/java/package-info.java
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * <strong>Table API (Java)</strong><br>
+ *
+ * A {@link org.apache.flink.table.api.java.BatchTableEnvironment} can be used to create a
+ * {@link org.apache.flink.table.api.Table} from a {@link org.apache.flink.api.java.DataSet}.
+ * Equivalently, a {@link org.apache.flink.table.api.java.StreamTableEnvironment} can be used to
+ * create a {@link org.apache.flink.table.api.Table} from a
+ * {@link org.apache.flink.streaming.api.datastream.DataStream}.
+ *
+ * <p>
+ * Tables can be used to perform SQL-like queries on data. Please have
+ * a look at {@link org.apache.flink.table.api.Table} to see which operations are supported and
+ * how query strings are written.
+ *
+ * <p>
+ * Example:
+ *
+ * <pre>{@code
+ * ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
+ * BatchTableEnvironment tEnv = TableEnvironment.getTableEnvironment(env);
+ *
+ * DataSet<WC> input = env.fromElements(
+ *   new WC("Hello", 1),
+ *   new WC("Ciao", 1),
+ *   new WC("Hello", 1));
+ *
+ * Table table = tEnv.fromDataSet(input);
+ *
+ * Table filtered = table
+ *     .groupBy("word")
+ *     .select("word.count as count, word")
+ *     .filter("count = 2");
+ *
+ * DataSet<WC> result = tEnv.toDataSet(filtered, WC.class);
+ *
+ * result.print();
+ * }</pre>
+ *
+ * <p>
+ * As seen above, a {@link org.apache.flink.table.api.Table} can be converted back to the
+ * underlying API representation using
+ * {@link org.apache.flink.table.api.java.BatchTableEnvironment#toDataSet(Table, java.lang.Class)}
+ * or {@link org.apache.flink.table.api.java.StreamTableEnvironment#toDataStream(Table, java.lang.Class)}}.
+ */
+package org.apache.flink.table.api.java;
+
+import org.apache.flink.table.api.Table;

http://git-wip-us.apache.org/repos/asf/flink/blob/ffe9ec8e/flink-libraries/flink-table/src/main/java/org/apache/flink/table/examples/java/WordCountSQL.java
----------------------------------------------------------------------
diff --git a/flink-libraries/flink-table/src/main/java/org/apache/flink/table/examples/java/WordCountSQL.java b/flink-libraries/flink-table/src/main/java/org/apache/flink/table/examples/java/WordCountSQL.java
new file mode 100644
index 0000000..e3b345c
--- /dev/null
+++ b/flink-libraries/flink-table/src/main/java/org/apache/flink/table/examples/java/WordCountSQL.java
@@ -0,0 +1,87 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.flink.table.examples.java;
+
+import org.apache.flink.table.api.Table;
+import org.apache.flink.api.java.DataSet;
+import org.apache.flink.api.java.ExecutionEnvironment;
+import org.apache.flink.table.api.java.BatchTableEnvironment;
+import org.apache.flink.table.api.TableEnvironment;
+
+/**
+ * Simple example that shows how the Batch SQL API is used in Java.
+ *
+ * This example shows how to:
+ *  - Convert DataSets to Tables
+ *  - Register a Table under a name
+ *  - Run a SQL query on the registered Table
+ *
+ */
+public class WordCountSQL {
+
+	// *************************************************************************
+	//     PROGRAM
+	// *************************************************************************
+
+	public static void main(String[] args) throws Exception {
+
+		// set up execution environment
+		ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
+		BatchTableEnvironment tEnv = TableEnvironment.getTableEnvironment(env);
+
+		DataSet<WC> input = env.fromElements(
+			new WC("Hello", 1),
+			new WC("Ciao", 1),
+			new WC("Hello", 1));
+
+		// register the DataSet as table "WordCount"
+		tEnv.registerDataSet("WordCount", input, "word, frequency");
+
+		// run a SQL query on the Table and retrieve the result as a new Table
+		Table table = tEnv.sql(
+			"SELECT word, SUM(frequency) as frequency FROM WordCount GROUP BY word");
+
+		DataSet<WC> result = tEnv.toDataSet(table, WC.class);
+
+		result.print();
+	}
+
+	// *************************************************************************
+	//     USER DATA TYPES
+	// *************************************************************************
+
+	public static class WC {
+		public String word;
+		public long frequency;
+
+		// public constructor to make it a Flink POJO
+		public WC() {
+		}
+
+		public WC(String word, long frequency) {
+			this.word = word;
+			this.frequency = frequency;
+		}
+
+		@Override
+		public String toString() {
+			return "WC " + word + " " + frequency;
+		}
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/flink/blob/ffe9ec8e/flink-libraries/flink-table/src/main/java/org/apache/flink/table/examples/java/WordCountTable.java
----------------------------------------------------------------------
diff --git a/flink-libraries/flink-table/src/main/java/org/apache/flink/table/examples/java/WordCountTable.java b/flink-libraries/flink-table/src/main/java/org/apache/flink/table/examples/java/WordCountTable.java
new file mode 100644
index 0000000..bdb50f5
--- /dev/null
+++ b/flink-libraries/flink-table/src/main/java/org/apache/flink/table/examples/java/WordCountTable.java
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.flink.table.examples.java;
+
+import org.apache.flink.table.api.Table;
+import org.apache.flink.api.java.DataSet;
+import org.apache.flink.api.java.ExecutionEnvironment;
+import org.apache.flink.table.api.java.BatchTableEnvironment;
+import org.apache.flink.table.api.TableEnvironment;
+
+/**
+  * Simple example for demonstrating the use of the Table API for a Word Count in Java.
+  *
+  * This example shows how to:
+  *  - Convert DataSets to Tables
+  *  - Apply group, aggregate, select, and filter operations
+  *
+  */
+public class WordCountTable {
+
+	// *************************************************************************
+	//     PROGRAM
+	// *************************************************************************
+
+	public static void main(String[] args) throws Exception {
+		ExecutionEnvironment env = ExecutionEnvironment.createCollectionsEnvironment();
+		BatchTableEnvironment tEnv = TableEnvironment.getTableEnvironment(env);
+
+		DataSet<WC> input = env.fromElements(
+				new WC("Hello", 1),
+				new WC("Ciao", 1),
+				new WC("Hello", 1));
+
+		Table table = tEnv.fromDataSet(input);
+
+		Table filtered = table
+				.groupBy("word")
+				.select("word, frequency.sum as frequency")
+				.filter("frequency = 2");
+
+		DataSet<WC> result = tEnv.toDataSet(filtered, WC.class);
+
+		result.print();
+	}
+
+	// *************************************************************************
+	//     USER DATA TYPES
+	// *************************************************************************
+
+	public static class WC {
+		public String word;
+		public long frequency;
+
+		// public constructor to make it a Flink POJO
+		public WC() {
+
+		}
+
+		public WC(String word, long frequency) {
+			this.word = word;
+			this.frequency = frequency;
+		}
+
+		@Override
+		public String toString() {
+			return "WC " + word + " " + frequency;
+		}
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/flink/blob/ffe9ec8e/flink-libraries/flink-table/src/main/java/org/apache/flink/table/explain/Node.java
----------------------------------------------------------------------
diff --git a/flink-libraries/flink-table/src/main/java/org/apache/flink/table/explain/Node.java b/flink-libraries/flink-table/src/main/java/org/apache/flink/table/explain/Node.java
new file mode 100644
index 0000000..4616728
--- /dev/null
+++ b/flink-libraries/flink-table/src/main/java/org/apache/flink/table/explain/Node.java
@@ -0,0 +1,145 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.explain;
+
+import java.util.List;
+
+public class Node {
+	private int id;
+	private String type;
+	private String pact;
+	private String contents;
+	private int parallelism;
+	private String driver_strategy;
+	private List<Predecessors> predecessors;
+	private List<Global_properties> global_properties;
+	private List<LocalProperty> local_properties;
+	private List<Estimates> estimates;
+	private List<Costs> costs;
+	private List<Compiler_hints> compiler_hints;
+
+	public int getId() {
+		return id;
+	}
+	public String getType() {
+		return type;
+	}
+	public String getPact() {
+		return pact;
+	}
+	public String getContents() {
+		return contents;
+	}
+	public int getParallelism() {
+		return parallelism;
+	}
+	public String getDriver_strategy() {
+		return driver_strategy;
+	}
+	public List<Predecessors> getPredecessors() {
+		return predecessors;
+	}
+	public List<Global_properties> getGlobal_properties() {
+		return global_properties;
+	}
+	public List<LocalProperty> getLocal_properties() {
+		return local_properties;
+	}
+	public List<Estimates> getEstimates() {
+		return estimates;
+	}
+	public List<Costs> getCosts() {
+		return costs;
+	}
+	public List<Compiler_hints> getCompiler_hints() {
+		return compiler_hints;
+	}
+}
+
+class Predecessors {
+	private String ship_strategy;
+	private String exchange_mode;
+
+	public String getShip_strategy() {
+		return ship_strategy;
+	}
+	public String getExchange_mode() {
+		return exchange_mode;
+	}
+}
+
+class Global_properties {
+	private String name;
+	private String value;
+
+	public String getValue() {
+		return value;
+	}
+	public String getName() {
+		return name;
+	}
+}
+
+class LocalProperty {
+	private String name;
+	private String value;
+
+	public String getValue() {
+		return value;
+	}
+	public String getName() {
+		return name;
+	}
+}
+
+class Estimates {
+	private String name;
+	private String value;
+
+	public String getValue() {
+		return value;
+	}
+	public String getName() {
+		return name;
+	}
+}
+
+class Costs {
+	private String name;
+	private String value;
+
+	public String getValue() {
+		return value;
+	}
+	public String getName() {
+		return name;
+	}
+}
+
+class Compiler_hints {
+	private String name;
+	private String value;
+
+	public String getValue() {
+		return value;
+	}
+	public String getName() {
+		return name;
+	}
+}