-
Notifications
You must be signed in to change notification settings - Fork 141
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 JDBC datasource #1361
Add JDBC datasource #1361
Conversation
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #1361 +/- ##
============================================
+ Coverage 98.43% 98.48% +0.05%
- Complexity 3775 3913 +138
============================================
Files 343 355 +12
Lines 9364 9708 +344
Branches 599 621 +22
============================================
+ Hits 9217 9561 +344
Misses 142 142
Partials 5 5
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 28 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Signed-off-by: Peng Huo <penghuo@gmail.com>
Signed-off-by: Peng Huo <penghuo@gmail.com>
Signed-off-by: Peng Huo <penghuo@gmail.com>
Signed-off-by: Peng Huo <penghuo@gmail.com>
jdbc/src/main/java/org/opensearch/sql/jdbc/functions/JDBCFunction.java
Outdated
Show resolved
Hide resolved
jdbc/src/main/java/org/opensearch/sql/jdbc/operator/JDBCResultSetResponseHandle.java
Show resolved
Hide resolved
jdbc/src/main/java/org/opensearch/sql/jdbc/operator/JDBCResultSetResponseHandle.java
Outdated
Show resolved
Hide resolved
import org.opensearch.sql.exception.SemanticCheckException; | ||
|
||
/** Describe a single datasource configuration option. */ | ||
@Builder |
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.
Why not to use a constructor or of
static method?
core/src/test/java/org/opensearch/sql/analysis/AnalyzerTestBase.java
Outdated
Show resolved
Hide resolved
docs/user/ppl/admin/jdbc.rst
Outdated
* ``url`` [Required]. | ||
* This parameters provides the URL to connect to a database instance provided endpoint. | ||
* ``driver`` [Required]. | ||
* This parameters provides the Driver to connect to a database instance provided endpoint. The only supported ``org.apache.hive.jdbc.HiveDriver`` |
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.
Why only HiveDriver
supported? There is no hardcoded restriction. Can I use anything else, for example, put SQLite
driver into CLASSPATH
and use it?
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.
Why only HiveDriver supported? There is no hardcoded restriction.
Yes, only hive supported. Explain the possible value in doc.
Can I use anything else, for example, put SQLite driver into CLASSPATH and use it?
You can, if you put SQLLite into classpath. But it is not prebuild.
Signed-off-by: Peng Huo <penghuo@gmail.com>
Signed-off-by: Peng Huo <penghuo@gmail.com>
Signed-off-by: Peng Huo <penghuo@gmail.com>
Signed-off-by: Peng Huo <penghuo@gmail.com>
Signed-off-by: Peng Huo <penghuo@gmail.com>
Signed-off-by: Peng Huo <penghuo@gmail.com>
Signed-off-by: Peng Huo <penghuo@gmail.com>
into "$projectDir/bin" | ||
} | ||
} | ||
command "$projectDir/bin/${SPARK_BINARY}/bin/spark-class org.apache.spark.deploy.master.Master -h localhost -p 7077 --webui-port 8080" |
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.
Is it cross-platform?
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.
To piggy-back on this, is it possible to run Spark in Docker?
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.
My main question is: can this data source be used with any JDBC driver?
If not, is it possible to make it clear to the users that Spark is the only supported JDBC data source?
I see now this was addressed in docs section.
I also had a question about if the change to security policies is required?
As a minor point, I flagged a few instance where Immutable*
types were used instead of Java core types.
// hive2 jdbc required | ||
permission java.io.FilePermission "*", "read, write"; | ||
permission java.security.SecurityPermission "*"; |
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.
Can this be made configuration option?
If I understand this correctly, this will permanently broaden permissions of the sql plugin yet they are only necessary when a JDBC data source with Hive2 driver is used.
into "$projectDir/bin" | ||
} | ||
} | ||
command "$projectDir/bin/${SPARK_BINARY}/bin/spark-class org.apache.spark.deploy.master.Master -h localhost -p 7077 --webui-port 8080" |
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.
To piggy-back on this, is it possible to run Spark in Docker?
case Types.TIMESTAMP: | ||
return TIMESTAMP; | ||
|
||
// we assume the result is json encoded string. refer https://docs.cloudera.com/HDPDocuments/HDP2/HDP-2.0.0.2/ds_Hive/jdbc-hs2.html, |
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.
Is this assumption safe to make for other JDBC drivers?
@Override | ||
public ExecutionEngine.Schema schema() { | ||
return new ExecutionEngine.Schema( | ||
ImmutableList.of(new ExecutionEngine.Schema.Column("result", "result", INTEGER))); |
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.
ImmutableList.of(new ExecutionEngine.Schema.Column("result", "result", INTEGER))); | |
List.of(new ExecutionEngine.Schema.Column("result", "result", INTEGER))); |
*/ | ||
public PropertiesParser() { | ||
options = | ||
new ImmutableList.Builder<Option>() |
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.
Can this be written using java.util.List
?
may I ask about why we close this pr? is there any continues planning for this? |
+1 @penghuo is it possible to proceed with changes? Looks like community can loose valuable feature. |
Description
org.apache.hive.jdbc.HiveDriver
.Issues Resolved
#1331
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.