Teradata JDBC Driver returns the wrong schema / column nullability

Connectivity
Teradata Employee

Re: Teradata JDBC Driver returns the wrong schema / column nullability

Hi, has the RFC been implemented yet? If so what version of the driver is needed please?

 

Cheers

John

Re: Teradata JDBC Driver returns the wrong schema / column nullability

I would also like to know if this has been implemented in the newest JDBC drivers. I'm running into the same issue when using Spark.

 

Thanks!

-Rafa

Teradata Employee

Re: Teradata JDBC Driver returns the wrong schema / column nullability

No, the feature has not been implemented yet. It is on the list of possible (but not committed) features for our upcoming Teradata JDBC Driver 16.10 release, which is planned to ship in the next few months.

Re: Teradata JDBC Driver returns the wrong schema / column nullability

Thanks for the quick response, tom. 

Enthusiast

Re: Teradata JDBC Driver 16.10 returns the wrong schema / column nullability

@tomnolan

 

I am testing the fix for ResultSetMetaData.isNullable with Teradata JDBC Driver 16.10.00.03 which includes the following 

DR 183490 Connection parameter MAYBENULL for ResultSetMetaData.isNullable variant behavior

But I still see the isNullable = false in the schema. Please advise.

Teradata Employee

Re: Teradata JDBC Driver 16.10 returns the wrong schema / column nullability

Connection parameter MAYBENULL=ON only has an effect when StatementInfo parcel support is available. If StatementInfo parcel support has been turned off on the server side via dbscontrol, or if it has been turned off with the SIP_SUPPORT=OFF connection parameter, then MAYBENULL=ON will have no effect.

 

When StatementInfo parcel support is available, connection parameter MAYBENULL=ON reports what the Teradata Database indicates in the StatementInfo parcel MayBeNull field. You can specify the LOG=DEBUG connection parameter to see the dump of the information conveyed in the StatementInfo parcel.

Enthusiast

Re: Teradata JDBC Driver 16.10 returns the wrong schema / column nullability

MAYBENULL=ON works now.

This is a hidden parameter, right? The JDBC driver does not surface this parameter in Aqua Data Studio (which tries to reflect all the JDBC Driver Properties from the jar file)

JDBC_Driver_Properties.png

The MAYBENULL property is documented online but not discovered from the terajdbc4.jar file.

Teradata Employee

Re: Teradata JDBC Driver 16.10 returns the wrong schema / column nullability

The MAYBENULL connection parameter is not "hidden". The MAYBENULL connection parameter is documented here:

 

http://developer.teradata.com/doc/connectivity/jdbc/reference/current/jdbcug_chapter_2.html#URL_MAYB...

 

Aqua Data Studio is not a Teradata product. The Teradata JDBC Driver does not "surface" anything for Aqua Data Studio.

Enthusiast

Re: Teradata JDBC Driver 16.10 returns the wrong schema / column nullability

Did more local unit tests, and it seemed that for data type CF (aka CHAR), the nullable flag is still set to FALSE.

 

DBC.Tables shows up in Spark RDD like below, the highlighted columns can be null in reality.
TD_JDBC_MAYBENULL.png

Is there any way to check why?

Teradata Employee

Re: Teradata JDBC Driver 16.10 returns the wrong schema / column nullability


ericsun2 wrote:

Did more local unit tests, and it seemed that for data type CF (aka CHAR), the nullable flag is still set to FALSE. DBC.Tables shows up in Spark RDD like below, the highlighted columns can be null in reality.


@ericsun2 what you displayed is the result set from a query. Please provide the SQL query that you used. We need to see your SQL query in order to answer your question about how the Y/N column values are composed.

 

Your query result set is not related to ResultSetMetaData or the MAYBENULL connection parameter. Please keep in mind that the MAYBENULL connection parameter only affects the behavior of the Teradata JDBC Driver's ResultSetMetaData interface. The MAYBENULL connection parameter has no effect on query results.