jtds TDS Protocol error: Invalid packet type - varchar

I'm connecting to Sybase ASA v11.0.1 using the jTDS library (v1.2.6) and I'm getting the following error every time I try to return varchar data
Protocol error: Invalid packet type 0x0
(or x4 or x7)
The queries work fine when I return a timestamp or numeric value. Any idea what is causing this error or how to resolve it?

It seems Sybase is not supported by 1.2.6 according to this https://sourceforge.net/p/jtds/discussion/104389/thread/d6e2efe3/
But I see this sometimes when the timeout closes the connection while I read the result set

Related

Getting py4j.protocol.Py4JJavaError: An error occurred while calling o65.jdbc. : java.sql.SQLException: Unsupported type TIMESTAMP_WITH_TIMEZONE

I am making JDBC connection to Denodo database using pyspark. The table that i am connecting to contains "TIMESTAMP_WITH_TIMEZONE" datatype for 2 columns. Since spark provides builtin jdbc connection to a handful of dbs only of which denodo is not a part, it is not able to recognize "TIMESTAMP_WITH_TIMEZONE" datatype and hence not able to map to any of its spark sql dataype.
To overcome this i am providing my custom schema(c_schema here) but this is not working as well and i am getting the same error. Below is the code snippet.
c_schema="game start date TIMESTAMP,game end date TIMESTAMP"
df = spark.read.jdbc("jdbc_url", "schema.table_name",properties={"user": "user_name", "password": "password","customSchema":c_schema,"driver": "com.denodo.vdp.jdbc.Driver"})
Please let me know how shall i fix this.
For anyone else facing this issue while connecting to denodo using spark,use CAST function to convert the datatype "TIMESTAMP_WITH_TIMEZONE" into any other datatype like String,Date or Timestamp etc. I had posted this question on denodo community page too and i have attached its official response.
CAST("PLANNED START DATE" as DATE) as "PLANNED_START_DATE"

Limit to using mariasql throwing error

I am using mariasql module in nodejs to connect with mariadb.
My query is:
select * from products where id=1 order by timestamp DESC LIMIT 0,10
This query works fine when I pass fixed values to limit.
Now I tried taking values from parameters.
select * from products where id=:pid order by timestamp DESC LIMIT :start,:end
This query is throwing following error.
{ Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''0','10'' at line 1 code: 1064 }
where as it accepts value from parameter for where clause.
It seems there is issue in mariasql node module. The issue is already reported in 2016 but there is no resolution yet.
Rather I found an alternative module which is for mysql but works fine with mariasql.

Error Launching Presto Server while trying to access Hive

I am trying to Launch Presto to query Hive ON RHEL Machine.
But while Launching the Presto Server via "./launcher run", i am getting the following error :
3 errors
com.google.inject.CreationException: Unable to create injector, see the following errors:
1) Configuration property 'http-server.http.port=8080 ' was not used
at io.airlift.bootstrap.Bootstrap.lambda$initialize$2(Bootstrap.java:235)
2) Error: Could not coerce value '8080 ' to int (property 'http-server.http.port') in order to call [public io.airlift.http.server.HttpServerConfig io.airlift.http.server.HttpServerConfig.setHttpPort(int)]
at io.airlift.http.server.HttpServerModule.configure(HttpServerModule.java:74)
3) Error: Invalid configuration property node.id: is malformed (for class io.airlift.node.NodeConfig.nodeId)
at io.airlift.node.NodeModule.configure(NodeModule.java:34)
3 errors
at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:466)
at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:155)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:107)
at com.google.inject.Guice.createInjector(Guice.java:96)
at io.airlift.bootstrap.Bootstrap.initialize(Bootstrap.java:242)
at com.facebook.presto.server.PrestoServer.run(PrestoServer.java:116)
at com.facebook.presto.server.PrestoServer.main(PrestoServer.java:67)
A few things. You need to remove the space after "http-server.http.port=8080".
Also, your node.id property is invalid. The node.id should match the following regex: "[A-Za-z0-9][_A-Za-z0-9-]*" (see https://github.com/airlift/airlift/blob/1e5694fb13ac6ca9cbdae1a1e60909c62fc7a64e/node/src/main/java/io/airlift/node/NodeConfig.java#L30).
same question: No factory for connector jmx
remove all /etc/* config files space

error in cassandra-driver RequestHandler.getDecision on timeout

uncaughtException: Cannot read property 'consistency' of null, TypeError: Cannot read property 'consistency' of null
at RequestHandler.getDecision (/mnt/infibond/infi-version2/node_modules/cassandra-driver/lib/request-handler.js:351:69)
at RequestHandler.handleError (/mnt/infibond/infi-version2/node_modules/cassandra-driver/lib/request-handler.js:304:27)
at /mnt/infibond/infi-version2/node_modules/cassandra-driver/lib/request-handler.js:285:19
at next (/mnt/infibond/infi-version2/node_modules/cassandra-driver/lib/utils.js:442:14)
at EventEmitter. (/mnt/infibond/infi-version2/node_modules/cassandra-driver/lib/request-handler.js:281:7)
I'm getting this exception in specific cases when i have a timeout (from what i can see in the driver the this.request is null.)
did anyone fix this localy or knows what could have made this error happen?
thanks!
The ticket you submitted looks like a driver bug: https://datastax-oss.atlassian.net/browse/NODEJS-296
It occurs when the Cassandra host is not responsive while preparing a query, which should not occur often as a query gets prepared once in the driver Client instance lifetime.
We've included it for the next patch release (v3.1.2).

phpcassa creating column family

I get a very strange error when creating column family with phpcassa, here is my code:
$sys = new SystemManager("127.0.0.1:9160");
$attr = array("comparator" => "UTF8Type");
$data = $sys->create_column_family("my_key_space", "user_likes", $attr);
So i'm not actually sure if it's a valid code, but i am quite sure it is, so this is the error i get:
TTransportException [ 0 ]: TSocket: timed out reading 4 bytes from 127.0.0.1:9160
And i get this error after a really long loading, maybe 30-60 secs, but any other code like retrieving or inserting data works perfectly, so what could it be?
I believe the attribute name should be "comparator_type" instead of "comparator".
As for why the server isn't responding, you'll probably find an Exception or stack trace in your Cassandra logs. If you're using an up-to-date version of Cassandra (like 1.1.5 or 1.1.6), I suggest opening a ticket in the Cassandra JIRA, because it should be returning an error instead of timing out.

Resources