HyukjinKwon commented on a change in pull request #25379: [SPARK-28474][SQL]
Hive 0.12 JDBC client can not handle binary type
URL: https://github.com/apache/spark/pull/25379#discussion_r311875791
##########
File path:
sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/SparkThriftServerProtocolVersionsSuite.scala
##########
@@ -215,12 +215,15 @@ class SparkThriftServerProtocolVersionsSuite extends
HiveThriftJdbcTest {
}
}
- // TODO: enable this test case after SPARK-28474
- ignore(s"$version get binary type") {
+ test(s"$version get binary type") {
testExecuteStatementWithProtocolVersion(version, "SELECT cast('ABC' as
binary)") { rs =>
assert(rs.next())
assert(rs.getString(1) === "ABC")
}
+ testExecuteStatementWithProtocolVersion(version, "SELECT cast(null as
binary)") { rs =>
Review comment:
last nit. Can we add another test that returns an arbitrary binary (not
UTF-8 encoded)? For instance,:
```scala
scala> sql("select cast(49960 as binary)").show()
+---------------------+
|CAST(49960 AS BINARY)|
+---------------------+
| [00 00 C3 28]|
+---------------------+
```
`C3 28` is an invalid UTF-8:
```python
>>> bytes.fromhex("c328").decode("utf-8")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 0:
invalid continuation byte
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]