-
Notifications
You must be signed in to change notification settings - Fork 80
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
feat: Add Flight SQL server support #6023
base: main
Are you sure you want to change the base?
Changes from 52 commits
185fd4f
04288bf
e79c493
2002936
84c737b
f7c9df1
3c4ed60
d045ac4
770956d
51e039d
a04f8ab
9caef38
329bdbf
7d00fe6
7b79e70
90bb328
9649204
7e96815
19701ba
af3d62c
c0e260e
158dfcb
995aaa2
3550037
8051c36
77961f9
141403a
3e130a0
088503c
c4af2b9
f593aa8
1aaabd8
8ec940e
9f5dffc
b57b972
b316621
3b221f0
54e1ad2
b69738f
0ddf2eb
78e8899
11313f0
7f426bf
c2d3ab1
1c564f4
2ca027b
1a9d0fa
96af11b
accfda8
742ad24
65fe87c
5092476
6df7379
7ef6ade
8e84a4c
a5e689c
6e3395c
ab17945
8614ff1
4e48079
cccfadd
bd5fb1e
5bc3182
38d8c0f
f1e587d
8650c2e
cfe3109
2b4db46
6bcf92e
f90463c
a040826
ca8e0b3
89f0d70
7d1f57b
938c05a
094401f
49a0195
9830ce0
4ecbe2a
20c18d3
260c679
00cd69e
171e5b1
fd4043a
bb77291
a902aef
6ae2ea9
306dc26
6a954f5
758c42c
d9d4a8b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# FlightSQL | ||
|
||
## Client | ||
devinrsmith marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## JDBC | ||
|
||
The default FlightSQL JDBC driver uses cookie authorization; by default, this is not enabled on the Deephaven server. | ||
To enable this, the request header "x-deephaven-auth-cookie-request" must be set to "true". | ||
|
||
Example JDBC connection string to self-signed TLS: | ||
|
||
``` | ||
jdbc:arrow-flight-sql://localhost:8443/?Authorization=Anonymous&useEncryption=1&disableCertificateVerification=1&x-deephaven-auth-cookie-request=true | ||
``` |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,67 @@ | ||||||
plugins { | ||||||
id 'java-library' | ||||||
id 'io.deephaven.project.register' | ||||||
} | ||||||
|
||||||
description = 'The Deephaven flight SQL library' | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
or possibly There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Flight SQL is how I see they refer to it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've updated lots of FlightSQL strings to Flight SQL. |
||||||
|
||||||
sourceSets { | ||||||
jdbcTest { | ||||||
compileClasspath += sourceSets.test.output | ||||||
runtimeClasspath += sourceSets.test.output | ||||||
} | ||||||
} | ||||||
|
||||||
configurations { | ||||||
jdbcTestImplementation.extendsFrom testImplementation | ||||||
jdbcTestRuntimeOnly.extendsFrom testRuntimeOnly | ||||||
jdbcTestAnnotationProcessor.extendsFrom testAnnotationProcessor | ||||||
} | ||||||
|
||||||
dependencies { | ||||||
api project(':server') | ||||||
implementation project(':sql') | ||||||
implementation project(':engine-sql') | ||||||
// :sql does not expose calcite as a dependency (maybe it should?); in the meantime, we want to make sure we can | ||||||
// provide reasonable error messages to the client | ||||||
implementation libs.calcite.core | ||||||
|
||||||
implementation libs.dagger | ||||||
implementation libs.arrow.flight.sql | ||||||
|
||||||
// testImplementation project(':extensions-csv') | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why commented out? worth a comment here discussing, or removing? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Meant to remove; was originally part of Jianfeng's testing, but no longer part of the new tests. |
||||||
testImplementation project(':authorization') | ||||||
testImplementation project(':server-test-utils') | ||||||
|
||||||
testAnnotationProcessor libs.dagger.compiler | ||||||
testImplementation libs.assertj | ||||||
testImplementation platform(libs.junit.bom) | ||||||
testImplementation libs.junit.jupiter | ||||||
testRuntimeOnly libs.junit.platform.launcher | ||||||
testRuntimeOnly libs.junit.vintage.engine | ||||||
testRuntimeOnly project(':log-to-slf4j') | ||||||
testRuntimeOnly libs.slf4j.simple | ||||||
|
||||||
jdbcTestImplementation project(':server-jetty') | ||||||
// Isolating to its own sourceSet / classpath because it breaks logging until we can upgrade to a newer version | ||||||
// See https://github.com/apache/arrow/pull/40908 | ||||||
// See https://github.com/deephaven/deephaven-core/issues/5947 | ||||||
jdbcTestRuntimeOnly libs.arrow.flight.sql.jdbc | ||||||
} | ||||||
|
||||||
test { | ||||||
useJUnitPlatform() | ||||||
} | ||||||
|
||||||
def jdbcTest = tasks.register('jdbcTest', Test) { | ||||||
description = 'Runs JDBC tests.' | ||||||
group = 'verification' | ||||||
|
||||||
testClassesDirs = sourceSets.jdbcTest.output.classesDirs | ||||||
classpath = sourceSets.jdbcTest.runtimeClasspath | ||||||
shouldRunAfter test | ||||||
|
||||||
useJUnitPlatform() | ||||||
} | ||||||
|
||||||
check.dependsOn jdbcTest |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
io.deephaven.project.ProjectType=JAVA_PUBLIC | ||
devinrsmith marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// | ||
// Copyright (c) 2016-2024 Deephaven Data Labs and Patent Pending | ||
// | ||
package io.deephaven.server; | ||
|
||
import io.deephaven.engine.context.ExecutionContext; | ||
import io.deephaven.io.logger.LogBuffer; | ||
import io.deephaven.io.logger.LogBufferGlobal; | ||
import io.deephaven.server.runner.GrpcServer; | ||
import io.deephaven.server.runner.MainHelper; | ||
import io.deephaven.util.SafeCloseable; | ||
import org.junit.jupiter.api.AfterEach; | ||
import org.junit.jupiter.api.BeforeAll; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Timeout; | ||
|
||
import java.io.IOException; | ||
import java.util.concurrent.TimeUnit; | ||
|
||
@Timeout(30) | ||
public abstract class DeephavenServerTestBase { | ||
|
||
public interface TestComponent { | ||
|
||
GrpcServer server(); | ||
|
||
ExecutionContext executionContext(); | ||
} | ||
|
||
protected TestComponent component; | ||
|
||
private LogBuffer logBuffer; | ||
private SafeCloseable executionContext; | ||
private GrpcServer server; | ||
protected int localPort; | ||
|
||
protected abstract TestComponent component(); | ||
|
||
@BeforeAll | ||
public static void setupOnce() throws IOException { | ||
MainHelper.bootstrapProjectDirectories(); | ||
} | ||
|
||
@BeforeEach | ||
public void setup() throws IOException { | ||
logBuffer = new LogBuffer(128); | ||
LogBufferGlobal.setInstance(logBuffer); | ||
component = component(); | ||
executionContext = component.executionContext().open(); | ||
server = component.server(); | ||
server.start(); | ||
localPort = server.getPort(); | ||
} | ||
|
||
@AfterEach | ||
void tearDown() throws InterruptedException { | ||
nbauernfeind marked this conversation as resolved.
Show resolved
Hide resolved
|
||
server.stopWithTimeout(10, TimeUnit.SECONDS); | ||
server.join(); | ||
executionContext.close(); | ||
LogBufferGlobal.clear(logBuffer); | ||
} | ||
} |
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.
I know this isn't a new change, but consider a named subtype here? Or would it make sense to just chain .flatten() on the end, as the table is already non-refreshing with a flat rowset?
Or, just add a local so we don't need to use the instance initializer?
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.
I've updated usages. I don't think subtype is desired, but I don't see any reason why it needs to be set in instance initializer.