-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Daniel Henneberger <[email protected]>
- Loading branch information
1 parent
fda065d
commit 59b725b
Showing
17 changed files
with
177 additions
and
41 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
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
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
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
10 changes: 4 additions & 6 deletions
10
sqrl-calcite/src/main/java/com/datasqrl/function/translations/DialectSqlTranslation.java
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 |
---|---|---|
@@ -1,17 +1,15 @@ | ||
package com.datasqrl.function.translations; | ||
|
||
import com.datasqrl.calcite.Dialect; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import org.apache.calcite.sql.SqlDialect; | ||
import org.apache.calcite.sql.SqlOperator; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public abstract class DialectSqlTranslation implements SqlTranslation { | ||
|
||
private final Dialect dialect; | ||
private final SqlDialect sqlDialect; | ||
private final SqlOperator operator; | ||
|
||
public DialectSqlTranslation(Dialect dialect, SqlOperator operator) { | ||
this.dialect = dialect; | ||
this.operator = operator; | ||
} | ||
} |
5 changes: 2 additions & 3 deletions
5
sqrl-calcite/src/main/java/com/datasqrl/function/translations/PostgresSqlTranslation.java
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 |
---|---|---|
@@ -1,14 +1,13 @@ | ||
package com.datasqrl.function.translations; | ||
|
||
import com.datasqrl.calcite.Dialect; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import org.apache.calcite.sql.SqlOperator; | ||
import org.apache.calcite.sql.dialect.PostgresqlSqlDialect; | ||
|
||
@Getter | ||
public abstract class PostgresSqlTranslation extends DialectSqlTranslation { | ||
|
||
public PostgresSqlTranslation(SqlOperator operator) { | ||
super(Dialect.POSTGRES, operator); | ||
super(PostgresqlSqlDialect.DEFAULT, operator); | ||
} | ||
} |
3 changes: 2 additions & 1 deletion
3
sqrl-calcite/src/main/java/com/datasqrl/function/translations/SnowflakeSqlTranslation.java
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 |
---|---|---|
@@ -1,12 +1,13 @@ | ||
package com.datasqrl.function.translations; | ||
|
||
import com.datasqrl.calcite.Dialect; | ||
import com.datasqrl.calcite.dialect.ExtendedSnowflakeSqlDialect; | ||
import lombok.Getter; | ||
import org.apache.calcite.sql.SqlOperator; | ||
|
||
@Getter | ||
public abstract class SnowflakeSqlTranslation extends DialectSqlTranslation { | ||
public SnowflakeSqlTranslation(SqlOperator operator) { | ||
super(Dialect.SNOWFLAKE, operator); | ||
super(ExtendedSnowflakeSqlDialect.DEFAULT, operator); | ||
} | ||
} |
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
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
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 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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> | ||
<groupId>com.datasqrl</groupId> | ||
<artifactId>sqrl-flink-lib</artifactId> | ||
<version>0.5.9-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>sqrl-translate-common</artifactId> | ||
|
||
<properties> | ||
<maven.compiler.source>11</maven.compiler.source> | ||
<maven.compiler.target>11</maven.compiler.target> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.apache.calcite</groupId> | ||
<artifactId>calcite-core</artifactId> | ||
<version>1.32.0</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.flink</groupId> | ||
<artifactId>flink-table-planner_2.12</artifactId> | ||
<version>1.19.1</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.datasqrl</groupId> | ||
<artifactId>sqrl-jdbc-1.19</artifactId> | ||
<version>${project.version}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
</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
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
File renamed without changes.
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
4 changes: 2 additions & 2 deletions
4
...function/translations/SqlTranslation.java → ...function/translations/SqlTranslation.java
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
package com.datasqrl.function.translations; | ||
|
||
import com.datasqrl.calcite.Dialect; | ||
import org.apache.calcite.sql.SqlCall; | ||
import org.apache.calcite.sql.SqlDialect; | ||
import org.apache.calcite.sql.SqlOperator; | ||
import org.apache.calcite.sql.SqlWriter; | ||
|
||
public interface SqlTranslation { | ||
Dialect getDialect(); | ||
SqlDialect getSqlDialect(); | ||
SqlOperator getOperator(); | ||
void unparse(SqlCall call, SqlWriter writer, int leftPrec, int rightPrec); | ||
} |
Oops, something went wrong.