-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add Looker SDK and streaming support #2
Conversation
core/src/main/java/org/apache/calcite/avatica/remote/looker/LookerRemoteMeta.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/avatica/remote/looker/LookerRemoteMeta.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/avatica/remote/Driver.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/avatica/remote/looker/LookerRemoteMeta.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/avatica/remote/looker/LookerRemoteMeta.java
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/avatica/remote/looker/LookerRemoteMeta.java
Outdated
Show resolved
Hide resolved
b407594
to
1e914b6
Compare
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.
Leaving some general readability comments for now. Will think harder about this later. Since this is going to be a permanent "fixup" commit, we should be pretty careful about making sure it remains easy to rebase on master for every bump, so good to think about exactly how to break it into smaller commits for easy maintenance in posterity.
build.gradle.kts
Outdated
@@ -176,6 +176,8 @@ allprojects { | |||
plugins.withId("java-library") { | |||
dependencies { | |||
"implementation"(platform(project(":bom"))) | |||
// Add the locally bundled LookerSDK fat jar | |||
"implementation"(files("../libs/looker-kotlin-sdk-f91f8ad.jar")) |
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.
Feels like we should file a cleanup bug to make this integration easier and throw it in the backlog for now.
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.
Yeah definitely - we will be building this jars locally for the foreseeable future. There was talk of getting this on maven and tied to official releases but I don't think that will happen soon.
core/src/main/java/org/apache/calcite/avatica/remote/looker/Driver.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/avatica/remote/looker/Driver.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/avatica/remote/looker/utils/package-info.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/avatica/remote/looker/LookerRemoteMeta.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/avatica/remote/looker/LookerRemoteMeta.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/avatica/remote/looker/utils/LookerSdkFactory.java
Outdated
Show resolved
Hide resolved
|
||
@Test | ||
public void driverThrowsAuthExceptionForBlankProperties() throws SQLException { | ||
Properties props = new Properties(); |
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.
http://go/unit-test-practices#structure
I find the arrange - act - assert structure does a lot for test readability. Just put some blank space in between each section. It's OK if some tests are more like arrange - act - assert - act - assert.
Thanks for the review @wnob! I am still exploring what we would need to have upstream, but my hope is that we can keep all meaningful changes in That said, response streaming into a series of IMO, Avatica has been open enough that we have not had to modify existing classes extensively. Any areas where this PR has done such modifications highlight potential Jira cases for upstream. |
78906b2
to
aa93bd9
Compare
core/src/main/java/org/apache/calcite/avatica/remote/looker/LookerRemoteMeta.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/avatica/remote/looker/LookerRemoteMeta.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/avatica/remote/looker/LookerRemoteMeta.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/avatica/remote/looker/LookerRemoteMeta.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/avatica/remote/looker/LookerRemoteMeta.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/avatica/remote/looker/LookerRemoteMeta.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/avatica/remote/looker/LookerRemoteMeta.java
Outdated
Show resolved
Hide resolved
dc7ec93
to
24e2532
Compare
b53d4d6
to
d9826eb
Compare
* Initial Looker SDK branch commit * Streaming LookerIterator * True streaming support * Make a specific Driver class and 'jdbc:looker:' protocol support * Add read timeout for stream * SQL Interface API endpoints * Use BlockingQueue of FrameEnvelopes rather than IO pipes * Fix illegal cast for queries with a single column * Stub driver for LookerRemoteMetaTest * Address feedback * Handle null values in stream * Rename driver to LookerDriver * Better error handling from API response * Support userAgent and make LookerResponseParser public for testing
* Initial Looker SDK branch commit * Streaming LookerIterator * True streaming support * Make a specific Driver class and 'jdbc:looker:' protocol support * Add read timeout for stream * SQL Interface API endpoints * Use BlockingQueue of FrameEnvelopes rather than IO pipes * Fix illegal cast for queries with a single column * Stub driver for LookerRemoteMetaTest * Address feedback * Handle null values in stream * Rename driver to LookerDriver * Better error handling from API response * Support userAgent and make LookerResponseParser public for testing
* Initial Looker SDK branch commit * Streaming LookerIterator * True streaming support * Make a specific Driver class and 'jdbc:looker:' protocol support * Add read timeout for stream * SQL Interface API endpoints * Use BlockingQueue of FrameEnvelopes rather than IO pipes * Fix illegal cast for queries with a single column * Stub driver for LookerRemoteMetaTest * Address feedback * Handle null values in stream * Rename driver to LookerDriver * Better error handling from API response * Support userAgent and make LookerResponseParser public for testing
* Initial Looker SDK branch commit * Streaming LookerIterator * True streaming support * Make a specific Driver class and 'jdbc:looker:' protocol support * Add read timeout for stream * SQL Interface API endpoints * Use BlockingQueue of FrameEnvelopes rather than IO pipes * Fix illegal cast for queries with a single column * Stub driver for LookerRemoteMetaTest * Address feedback * Handle null values in stream * Rename driver to LookerDriver * Better error handling from API response * Support userAgent and make LookerResponseParser public for testing
* Initial Looker SDK branch commit * Streaming LookerIterator * True streaming support * Make a specific Driver class and 'jdbc:looker:' protocol support * Add read timeout for stream * SQL Interface API endpoints * Use BlockingQueue of FrameEnvelopes rather than IO pipes * Fix illegal cast for queries with a single column * Stub driver for LookerRemoteMetaTest * Address feedback * Handle null values in stream * Rename driver to LookerDriver * Better error handling from API response * Support userAgent and make LookerResponseParser public for testing
* Initial Looker SDK branch commit * Streaming LookerIterator * True streaming support * Make a specific Driver class and 'jdbc:looker:' protocol support * Add read timeout for stream * SQL Interface API endpoints * Use BlockingQueue of FrameEnvelopes rather than IO pipes * Fix illegal cast for queries with a single column * Stub driver for LookerRemoteMetaTest * Address feedback * Handle null values in stream * Rename driver to LookerDriver * Better error handling from API response * Support userAgent and make LookerResponseParser public for testing
Adds functionality described in go/scaling-avatica-looker-api.
To enable the the Looker SDK use
jdbc:looker
(as opposed tojdbc:avatica:remote
) as the JDBC URL protocol.NOTE: This is awaiting changes from b/288031194. Don't expect this to work properly without that work completed.
TODOs:
sql_interface
endpoints.AuthToken
s rather than raw header.metadata
fromjson_bi
result format. We currently skip right torows
.Prepare
then laterExecute
. Currently we only overridePrepareAndExecute