phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francis Chuang <francischu...@apache.org>
Subject Breaking change in Avatica-Go when handling null and empty strings for Apache Phoenix
Date Mon, 07 Jan 2019 03:42:28 GMT
This is a heads up regarding a breaking change that is currently in 
avatica-go master and will be released as the next major version, 4.0.0.

In Apache Phoenix, string columns set to null or an empty string ("") 
are considered to be equivalent. For more details on why this is the 
case see [1].

While fixing a bug to correctly work with null values in avatica-go [2], 
I had to break existing behavior.

Previous behavior: A string column set to null or an empty string will 
be returned as an empty string.

New behavior: A string column set to null or an empty string will be 
returned as a null.

The reason for this change is to take advantage of Go's database/sql 
package's builtin NullString type [3]. This type allows userland code to 
scan nullable columns into a variable without any errors.

Note: This breaking change will be part of 4.0.0 and will not affect 
users using 3.x.x. However, to take advantage of database/sql's null 
types, you will need to upgrade to 4.0.0 (when it is released) and 
upgrade your import paths to github.com/apache/calcite-avatica-go/v4
This change is only applicable for Apache Phoenix and will not affect 
HSQLDB.

[1] https://issues.apache.org/jira/browse/PHOENIX-947
[2] https://issues.apache.org/jira/browse/CALCITE-2763
[3] https://golang.org/pkg/database/sql/#NullString

Mime
View raw message