avatica | DEPRECATED | SQL Database library
kandi X-RAY | avatica Summary
kandi X-RAY | avatica Summary
An Apache Phoenix/Avatica driver for Go's database/sql package.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- ParseDSN parses a DSN from a DSN .
- newRows creates a new row for a query .
- typeedValueToNative converts a TypedValue to native Go type .
- NewHTTPClient creates a new HTTP client
- classNameFromRequest returns the class name of the class .
- responseFromClassName returns the message from the given class name
- errorResponseToResponseError converts an ErrorResponseError to a ResponseError
- driverNamedValueToNamedValue converts driver . NamedValues to driver . Value
- driverValueToNamedValue converts a list of driver . Value to a slice of NamedValues .
- NumInput returns the number of parameters in the statement .
avatica Key Features
avatica Examples and Code Snippets
Community Discussions
Trending Discussions on avatica
QUESTION
I'm attempting to use a PreparedStatement placeholder for an argument to a sql aggregation function. The query works fine if I replace the ?
placeholder with a numeric value and get rid of the setDouble
call.
ANSWER
Answered 2021-Mar-15 at 18:19Given the root cause error message:
java.lang.RuntimeException: org.apache.calcite.tools.ValidationException: org.apache.calcite.runtime.CalciteContextException: From line 1, column 8 to line 1, column 58: Cannot apply 'DS_GET_QUANTILE' to arguments of type 'DS_GET_QUANTILE(, )'. Supported form(s): 'DS_GET_QUANTILE(, )'
This is a problem with type inference for the parameter. Try explicitly casting the parameter to a numeric type, e.g. cast(? as double)
.
QUESTION
I am trying to connect Gemfire 8.2 using apache calcite geode adopter. As per following logs its connectied properly but while try to execute query getting exception .
Note : http://calcite.apache.org/news/2018/03/19/release-1.16.0/
Moreover, a new adapter to read data from Apache Geode was added in this release. In addition, more progress has been made for the existing adapters
1) Connection class
...ANSWER
Answered 2018-Mar-21 at 16:51The Geode Adapter is compiled with Geode version: 1.3 (https://github.com/apache/calcite/blob/master/pom.xml#L79) that corresponds to Gemfire 9.x.
Because the Gemfire 8.x is code incompatible with Gemfire 9.x. you would not be able to use the Geode Adapter on the Gemfire 8.x or older. Furthermore the OQL in Gemfire 8.x doesn't support GROUP BY construct either.
QUESTION
Following https://calcite.apache.org/docs/tutorial.html, I ran Apache Calcite using SqlLine. I tried activating tracing as instructed in https://calcite.apache.org/docs/howto.html#tracing. However, I don't get any logging. Here is the content of my session (hopefully containing all relevant information):
...ANSWER
Answered 2019-Jun-18 at 08:29I have the impression that problem lies to the underlying implementation of the logger.
I am not an expert on logging configurations but I think specifying the properties file through -Djava.util.logging.config.file
does not have any effect since the logger that is used (according to the classpath you provided) is the Log4J implementation (slf4j-log4j12-1.7.25.jar
) and not the one of the jdk (https://mvnrepository.com/artifact/org.slf4j/slf4j-jdk14/1.7.26).
I think that the right property to use for the log4j implementation is the folowing:
-Dlog4j.configuration=file:C:\Users\user0\workspaces\apache-projects\apache-calcite\core\src\test\resources\log4j.properties
QUESTION
I have 3 phoenix query servers running behind a knox gateway (hiding kerberos auth complexity), accessed through Simba's odbc driver. I manage to reach one phoenix query server and launch queries through knox, by directly mapping, in topology file, avatica service to the internal ip address and port of one phoenix query server in my internal network. I would like to have knox randomly access either of my 3 phoenix query servers, not just one. Do you know if i can achieve this with zookeeper and how i can configure it to do this ?
I've already tried to make some loadbalancing bu making knox topology pointing on an nginx reverse proxy, setting as upstream my 3 PQS but i'm having a 401 error, likewise my credentials were transmitted trough the proxy
my odbc.ini file :
...ANSWER
Answered 2019-Jun-14 at 15:29I finally managed to have my 3 PQS reached by following know ha guide (https://cwiki.apache.org/confluence/display/KNOX/Dynamic+HA+Provider+Configuration), adding in my topology file an ha provider section and providing 3 urls in the service configuration instead of one:
QUESTION
I am trying out BeamSQL
in shell
and want to test how unbounded sources work in terms of usability and performance. Reading the documentation over here, I created an external table as follows-
ANSWER
Answered 2019-May-16 at 16:01Looks like you don't have the PubsubIO available at the runtime. The shell by default doesn't include any extra IOs (or runners), you have to explicitly build and have all such extra stuff on the classpath to be able to use it. It should be sufficient to specify the required SDK modules in the command line arg -Pbeam.sql.shell.bundled
when building the shell.
For example, this command builds and installs the shell bundled with the Flink Runner, Kafka IO and Google Cloud IOs:
QUESTION
I am currently attempting to connect mysql using calcite. However, I had problems executing SQL statements
When I use this sql to excute,it works.
ResultSet resultSet = statement.executeQuery( "select * from ex.depts");
But I would like to access a table named like this "primary_test",it failed.
Exception in thread "main" java.sql.SQLException: Error while executing SQL "select * from ex.primary_test": From line 1, column 15 to line 1, column 29: Object 'primary_test' not found within 'ex' at org.apache.calcite.avatica.Helper.createException(Helper.java:56) at org.apache.calcite.avatica.Helper.createException(Helper.java:41) at org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:163) at org.apache.calcite.avatica.AvaticaStatement.executeQuery(AvaticaStatement.java:227) at CalciteMysqlConnectionIns.main(CalciteMysqlConnectionIns.java:44) Caused by: org.apache.calcite.runtime.CalciteContextException: From line 1, column 15 to line 1, column 29: Object 'primary_test' not found within 'ex' at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.apache.calcite.runtime.Resources$ExInstWithCause.ex(Resources.java:463) at org.apache.calcite.sql.SqlUtil.newContextException(SqlUtil.java:787) at org.apache.calcite.sql.SqlUtil.newContextException(SqlUtil.java:772) at org.apache.calcite.sql.validate.SqlValidatorImpl.newValidationError(SqlValidatorImpl.java:4788) at org.apache.calcite.sql.validate.IdentifierNamespace.resolveImpl(IdentifierNamespace.java:166) at org.apache.calcite.sql.validate.IdentifierNamespace.validateImpl(IdentifierNamespace.java:177) at org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84) at org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:977) at org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:953) at org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:3050) at org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:3032) at org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelect(SqlValidatorImpl.java:3302) at org.apache.calcite.sql.validate.SelectNamespace.validateImpl(SelectNamespace.java:60) at org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84) at org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:977) at org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:953) at org.apache.calcite.sql.SqlSelect.validate(SqlSelect.java:216) at org.apache.calcite.sql.validate.SqlValidatorImpl.validateScopedExpression(SqlValidatorImpl.java:928) at org.apache.calcite.sql.validate.SqlValidatorImpl.validate(SqlValidatorImpl.java:632) at org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery(SqlToRelConverter.java:556) at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:265) at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:231) at org.apache.calcite.prepare.CalcitePrepareImpl.prepare2_(CalcitePrepareImpl.java:772) at org.apache.calcite.prepare.CalcitePrepareImpl.prepare_(CalcitePrepareImpl.java:636) at org.apache.calcite.prepare.CalcitePrepareImpl.prepareSql(CalcitePrepareImpl.java:606) at org.apache.calcite.jdbc.CalciteConnectionImpl.parseQuery(CalciteConnectionImpl.java:229) at org.apache.calcite.jdbc.CalciteMetaImpl.prepareAndExecute(CalciteMetaImpl.java:550) at org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal(AvaticaConnection.java:675) at org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:156) ... 2 more Caused by: org.apache.calcite.sql.validate.SqlValidatorException: Object 'primary_test' not found within 'ex' at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.apache.calcite.runtime.Resources$ExInstWithCause.ex(Resources.java:463) at org.apache.calcite.runtime.Resources$ExInst.ex(Resources.java:572) ... 30 more
I have used many different query like
ResultSet resultSet = statement.executeQuery( "select * from ex.\"primary_test\"");
but it doesn't work. Could someone help me with this question?
my code is like following:
...ANSWER
Answered 2019-Apr-08 at 08:18you can try this:
QUESTION
I am using elasticsearch version-6.1.1.I have downloaded the calcite framework project and build it in my machine following the tutorial at (https://calcite.apache.org/docs/tutorial.html) and when i tried to connect to elasticsearch using the Elasticsearch2adaptor of calcite as given here(https://calcite.apache.org/docs/elasticsearch_adapter.html).i'm getting the following error ERROR:
...ANSWER
Answered 2018-Jan-19 at 07:06The adapter mentioned by you is not compatible with Elasticsearch 6.x
Quoting from web page of the adapter
This adapter is targeted for Elasticsearch 2.x. To use Calcite with Elasticsearch 5.x+ you can use the factory of the adapter targeted for Elasticsearch 5.x:
You can downgrade the Elasticsearch to version 2.x or 5.x, and it should work
QUESTION
I have a JDBC client calling a servlet.
Here's my client :
...ANSWER
Answered 2018-Jun-27 at 07:53It's fine, after trying to get the attributes, parameters, etc... of the request, turns out the credentials were just in the request...
Doing this in the servlet let me access the user and password used for the connection in the client (after some JSON parsing) :
String myRequest = request.getReader().lines().collect(Collectors.joining(System.lineSeparator()));
QUESTION
I am using apache-drill-1.12.0 on Windows 10. I get "no current connection" errors when sending any queries. Also, drill web console which should be working on localhost:8047 is not working.
I have searched many answers on StackOverflow said about setting JAVA_HOME environment variable correctly to avoid errors.
I have set JAVA_HOME system variable correctly and here is the proof for that.
...ANSWER
Answered 2018-May-23 at 18:54Looks like you have used older (or newer) version of Drill earlier and that version created plugin configs in your /tmp/drill/sys.storage_plugins/ folder. If any plugin config is changed, the user should remove that directory to use other version of Drill.
I suggest you to use the latest Drill 1.13 version of Drill and to clean your /tmp/drill/ directory.
QUESTION
I am using a third party jdbc jar (drill-jdbc-all-1.13.jar) in the jboss/modules/company/jdbc/other, with a module.xml as here :
...ANSWER
Answered 2018-May-15 at 20:00I think the problem isn't that your JAXP implementation isn't being used, it's that you're including a JAXP API, which is disallowed. You should ensure that the drill-jdbc-all-*.jar
does not include javax.xml
classes.
Generally a ClassCastException
such as this is going to indicate duplicated API JARs.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install avatica
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page