-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Looker Model metadata #37
Conversation
This allows dependent projects to run tests using Bazel. (Previously, DiffRepository would give errors because Bazel has packaged the .xml files it needs inside JAR files.) Close apache#2750
…pache#7) Related to CALCITE-5346. Previously we relied on the parser to map unrecognized datatypes to a known type using SqlAlienSystemTypeNameSpec. This worked but made it difficult to change or add new types as necessary. One would have to update at least 3 different parsers (babel, core, server) to make a change. This change allows for declaring user-defined types at the root of a schema model and allows for easy type alias mapping. These data types are shared by all schema in the model so cast and DDL expressions do not need to scope data type references to a particular sub-schema. For example: ``` inline: { version: '1.0', types: [ { name: 'BOOL', type: 'BOOLEAN' }, { name: 'BYTES', type: 'VARBINARY' }, ... ], ``` Allows for `CAST("true" as BOOL)`
…de node) (apache#28) * Add tests to fix later * Update test * Add in type field to RelJson.toJson and update tests * CALCITE-5607 / Serialize return type during RelJson.toJson(RexNode node) * Update test comment --------- Co-authored-by: Oliver Lee <oliverlee@google.com>
…K, WEEK(WEEKDAY) (apache#32) * [CALCITE-5449] Allow EXTRACT() to accept time frames * Fix getMonotonicity() override * Lint * Refactor DAYOFWEEK, DAYOFYEAR --------- Co-authored-by: tanclary <116591231+tanclary@users.noreply.github.com> Co-authored-by: Tanner Clary <tannerclary@google.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot to submit, here you go!
core/src/main/java/org/apache/calcite/jdbc/CalciteMetaImpl.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/jdbc/CalciteMetaImpl.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/jdbc/CalciteMetaImpl.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/jdbc/CalciteMetaImpl.java
Outdated
Show resolved
Hide resolved
core/src/test/java/org/apache/calcite/jdbc/CalciteRemoteDriverTest.java
Outdated
Show resolved
Hide resolved
@@ -284,6 +295,52 @@ protected static Connection getRemoteConnection() throws SQLException { | |||
.returns(CalciteAssert.checkResultContains("COLUMN_NAME=EMPNO")); | |||
} | |||
|
|||
@Test void testRemoteColumnsMetadata() throws SQLException { | |||
final Connection connection = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: arrange your tests in AAA form: http://go/unit-testing-practices#structure
* Gets Looker Explore metadata if available. | ||
*/ | ||
default HashMap<String, Object> getTableMetadata() { | ||
HashMap<String, Object> map = new HashMap<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's avoid hash maps in APIs whenever possible, even internal ones. This is how helltool ended up with so many functions with a single hash map argument instead of individual arguments.
The best thing for here is probably to define a new data class called ExtraTableMetadata
that functions like the hash map, but with all the expected fields spelled out.
839917c
to
78c444d
Compare
78c444d
to
cbb02c6
Compare
…hen instantiating tables in the CalciteMetaImpl tables() call
core/src/main/java/org/apache/calcite/jdbc/CalciteMetaImpl.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/jdbc/CalciteConnectionImpl.java
Outdated
Show resolved
Hide resolved
|
||
// Got a RedundantModifier alert, however CalciteMetaImpl does need this constructor to be | ||
// explicitly public in order to create an instance. | ||
// CHECKSTYLE: IGNORE 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No description provided.