-
Notifications
You must be signed in to change notification settings - Fork 479
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #324 from MyCATApache/hbt2
发布版本
- Loading branch information
Showing
34 changed files
with
751 additions
and
182 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
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
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
32 changes: 32 additions & 0 deletions
32
hbt/src/main/java/io/mycat/calcite/prepare/CalciteSqlValidator.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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package io.mycat.calcite.prepare; | ||
|
||
import org.apache.calcite.adapter.java.JavaTypeFactory; | ||
import org.apache.calcite.prepare.CalciteCatalogReader; | ||
import org.apache.calcite.rel.type.RelDataType; | ||
import org.apache.calcite.sql.SqlInsert; | ||
import org.apache.calcite.sql.SqlOperatorTable; | ||
import org.apache.calcite.sql.validate.SqlValidatorImpl; | ||
|
||
/** Validator. */ | ||
class CalciteSqlValidator extends SqlValidatorImpl { | ||
|
||
CalciteSqlValidator(SqlOperatorTable opTab, | ||
CalciteCatalogReader catalogReader, JavaTypeFactory typeFactory, | ||
Config config) { | ||
super(opTab, catalogReader, typeFactory, config); | ||
} | ||
|
||
@Override protected RelDataType getLogicalSourceRowType( | ||
RelDataType sourceRowType, SqlInsert insert) { | ||
final RelDataType superType = | ||
super.getLogicalSourceRowType(sourceRowType, insert); | ||
return ((JavaTypeFactory) typeFactory).toSql(superType); | ||
} | ||
|
||
@Override protected RelDataType getLogicalTargetRowType( | ||
RelDataType targetRowType, SqlInsert insert) { | ||
final RelDataType superType = | ||
super.getLogicalTargetRowType(targetRowType, insert); | ||
return ((JavaTypeFactory) typeFactory).toSql(superType); | ||
} | ||
} |
Oops, something went wrong.