-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FLINK-6962] Add a create table SQL DDL
- Loading branch information
Showing
23 changed files
with
3,033 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,325 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
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. | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<artifactId>flink-table</artifactId> | ||
<groupId>org.apache.flink</groupId> | ||
<version>1.9-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>flink-sql-parser</artifactId> | ||
<name>flink-sql-parser</name> | ||
|
||
<packaging>jar</packaging> | ||
|
||
<properties> | ||
<!-- override parent pom --> | ||
<test.excludedGroups/> | ||
<calcite.version>1.19.0</calcite.version> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.apache.flink</groupId> | ||
<artifactId>flink-shaded-guava</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.calcite</groupId> | ||
<artifactId>calcite-core</artifactId> | ||
<!-- When updating the Calcite version, make sure to update the dependency exclusions --> | ||
<version>${calcite.version}</version> | ||
<exclusions> | ||
<!-- | ||
Dependencies that are not needed for how we use Calcite right now. | ||
"mvn dependency:tree" as of Calcite 1.19.0: | ||
[INFO] +- org.apache.calcite:calcite-core:jar:1.19.0:compile | ||
[INFO] | +- org.apache.calcite.avatica:avatica-core:jar:1.13.0:compile | ||
[INFO] | +- org.apache.calcite:calcite-linq4j:jar:1.19.0:compile | ||
[INFO] | +- org.apache.commons:commons-lang3:jar:3.3.2:compile | ||
[INFO] | +- com.fasterxml.jackson.core:jackson-core:jar:2.9.6:compile | ||
[INFO] | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.9.6:compile | ||
[INFO] | +- com.fasterxml.jackson.core:jackson-databind:jar:2.9.6:compile | ||
[INFO] | +- com.google.guava:guava:jar:19.0:compile | ||
[INFO] | \- com.jayway.jsonpath:json-path:jar:2.4.0:compile | ||
--> | ||
<exclusion> | ||
<groupId>org.apache.calcite.avatica</groupId> | ||
<artifactId>avatica-metrics</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>org.apache.calcite.avatica</groupId> | ||
<artifactId>avatica-core</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>com.google.protobuf</groupId> | ||
<artifactId>protobuf-java</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>org.apache.httpcomponents</groupId> | ||
<artifactId>httpclient</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>org.apache.httpcomponents</groupId> | ||
<artifactId>httpcore</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>org.apache.commons</groupId> | ||
<artifactId>commons-dbcp2</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>com.esri.geometry</groupId> | ||
<artifactId>esri-geometry-api</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>com.fasterxml.jackson.dataformat</groupId> | ||
<artifactId>jackson-dataformat-yaml</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>com.yahoo.datasketches</groupId> | ||
<artifactId>sketches-core</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>net.hydromatic</groupId> | ||
<artifactId>aggdesigner-algorithm</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.calcite.avatica</groupId> | ||
<artifactId>avatica-core</artifactId> | ||
<version>1.13.0</version> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>com.fasterxml.jackson.core</groupId> | ||
<artifactId>jackson-core</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>com.fasterxml.jackson.core</groupId> | ||
<artifactId>jackson-databind</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>com.fasterxml.jackson.core</groupId> | ||
<artifactId>jackson-annotations</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.calcite</groupId> | ||
<artifactId>calcite-core</artifactId> | ||
<version>${calcite.version}</version> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>org.apache.calcite.avatica</groupId> | ||
<artifactId>avatica-core</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
<scope>test</scope> | ||
<type>test-jar</type> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<!-- Extract parser grammar template from calcite-core.jar and put | ||
it under ${project.build.directory} where all freemarker templates are. --> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-dependency-plugin</artifactId> | ||
<version>2.8</version> | ||
<executions> | ||
<execution> | ||
<id>unpack-parser-template</id> | ||
<phase>initialize</phase> | ||
<goals> | ||
<goal>unpack</goal> | ||
</goals> | ||
<configuration> | ||
<artifactItems> | ||
<artifactItem> | ||
<groupId>org.apache.calcite</groupId> | ||
<artifactId>calcite-core</artifactId> | ||
<type>jar</type> | ||
<overWrite>true</overWrite> | ||
<outputDirectory>${project.build.directory}/</outputDirectory> | ||
<includes>**/Parser.jj</includes> | ||
</artifactItem> | ||
</artifactItems> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<!-- adding fmpp code gen --> | ||
<plugin> | ||
<artifactId>maven-resources-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>copy-fmpp-resources</id> | ||
<phase>initialize</phase> | ||
<goals> | ||
<goal>copy-resources</goal> | ||
</goals> | ||
<configuration> | ||
<outputDirectory>${project.build.directory}/codegen</outputDirectory> | ||
<resources> | ||
<resource> | ||
<directory>src/main/codegen</directory> | ||
<filtering>false</filtering> | ||
</resource> | ||
</resources> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>com.googlecode.fmpp-maven-plugin</groupId> | ||
<artifactId>fmpp-maven-plugin</artifactId> | ||
<version>1.0</version> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.freemarker</groupId> | ||
<artifactId>freemarker</artifactId> | ||
<version>2.3.25-incubating</version> | ||
</dependency> | ||
</dependencies> | ||
<executions> | ||
<execution> | ||
<id>generate-fmpp-sources</id> | ||
<phase>generate-sources</phase> | ||
<goals> | ||
<goal>generate</goal> | ||
</goals> | ||
<configuration> | ||
<cfgFile>${project.build.directory}/codegen/config.fmpp</cfgFile> | ||
<outputDirectory>target/generated-sources</outputDirectory> | ||
<templateDirectory>${project.build.directory}/codegen/templates</templateDirectory> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>build-helper-maven-plugin</artifactId> | ||
<version>1.5</version> | ||
<executions> | ||
<execution> | ||
<id>add-generated-sources</id> | ||
<phase>process-sources</phase> | ||
<goals> | ||
<goal>add-source</goal> | ||
</goals> | ||
<configuration> | ||
<sources> | ||
<source>${project.build.directory}/generated-sources</source> | ||
</sources> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>javacc-maven-plugin</artifactId> | ||
<version>2.4</version> | ||
<executions> | ||
<execution> | ||
<phase>generate-sources</phase> | ||
<id>javacc</id> | ||
<goals> | ||
<goal>javacc</goal> | ||
</goals> | ||
<configuration> | ||
<sourceDirectory>${project.build.directory}/generated-sources/</sourceDirectory> | ||
<includes> | ||
<include>**/Parser.jj</include> | ||
</includes> | ||
<!-- This must be kept synced with Apache Calcite. --> | ||
<lookAhead>2</lookAhead> | ||
<isStatic>false</isStatic> | ||
<outputDirectory>${project.build.directory}/generated-sources/</outputDirectory> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-shade-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>shade-flink</id> | ||
<configuration> | ||
<shadeTestJar>false</shadeTestJar> | ||
<filters> | ||
<filter> | ||
<artifact>*:*</artifact> | ||
<excludes> | ||
<!-- excluded all these files for a clean flink-sql-parser jar --> | ||
<exclude>org-apache-calcite-jdbc.properties</exclude> | ||
<exclude>common.proto</exclude> | ||
<exclude>requests.proto</exclude> | ||
<exclude>responses.proto</exclude> | ||
<exclude>codegen/**</exclude> | ||
<exclude>META-INF/*.SF</exclude> | ||
<exclude>META-INF/*.DSA</exclude> | ||
<exclude>META-INF/*.RSA</exclude> | ||
<exclude>META-INF/services/java.sql.Driver</exclude> | ||
<!-- not relocated for now, because it is needed by Calcite --> | ||
<!--<exclude>org.codehaus.commons.compiler.properties</exclude>--> | ||
</excludes> | ||
</filter> | ||
</filters> | ||
<artifactSet> | ||
<includes combine.children="append"> | ||
<include>org.apache.calcite:*</include> | ||
<include>org.apache.calcite.avatica:*</include> | ||
</includes> | ||
<excludes> | ||
<exclude>com.fasterxml.jackson.core:*</exclude> | ||
</excludes> | ||
</artifactSet> | ||
<relocations> | ||
<!-- Relocations currently should be consistent with flink-table --> | ||
<relocation> | ||
<pattern>com.google</pattern> | ||
<shadedPattern>org.apache.flink.shaded.calcite.com.google</shadedPattern> | ||
</relocation> | ||
<relocation> | ||
<pattern>org.eigenbase</pattern> | ||
<shadedPattern>org.apache.flink.shaded.calcite.org.eigenbase</shadedPattern> | ||
</relocation> | ||
<relocation> | ||
<pattern>com.jayway</pattern> | ||
<shadedPattern>org.apache.flink.shaded.calcite.shaded.com.jayway</shadedPattern> | ||
</relocation> | ||
</relocations> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# 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. | ||
|
||
# This file is an FMPP (http://fmpp.sourceforge.net/) configuration file to | ||
# allow clients to extend Calcite's SQL parser to support application specific | ||
# SQL statements, literals or data types. | ||
# | ||
# Calcite's parser grammar file (Parser.jj) is written in javacc | ||
# (https://javacc.org/) with Freemarker (http://freemarker.org/) variables | ||
# to allow clients to: | ||
# 1. have custom parser implementation class and package name. | ||
# 2. insert new parser method implementations written in javacc to parse | ||
# custom: | ||
# a) SQL statements. | ||
# b) literals. | ||
# c) data types. | ||
# 3. add new keywords to support custom SQL constructs added as part of (2). | ||
# 4. add import statements needed by inserted custom parser implementations. | ||
# | ||
# Parser template file (Parser.jj) along with this file are packaged as | ||
# part of the calcite-core-<version>.jar under "codegen" directory. | ||
|
||
data: { | ||
parser: tdd(../data/Parser.tdd) | ||
} | ||
|
||
freemarkerLinks: { | ||
includes: includes/ | ||
} |
Oops, something went wrong.