juliuszsompolski commented on a change in pull request #25277:
[SPARK-28637][SQL] Thriftserver support interval type
URL: https://github.com/apache/spark/pull/25277#discussion_r320475005
##########
File path:
sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkExecuteStatementOperation.scala
##########
@@ -308,7 +311,11 @@ private[hive] class SparkExecuteStatementOperation(
object SparkExecuteStatementOperation {
def getTableSchema(structType: StructType): TableSchema = {
val schema = structType.map { field =>
- val attrTypeString = if (field.dataType == NullType) "void" else
field.dataType.catalogString
+ val attrTypeString = field.dataType match {
+ case NullType => "void"
+ case CalendarIntervalType => "string"
+ case other => other.catalogString
Review comment:
Ok. I understand now.
I was wondering how does it work that if you here create a `TableSchema`
with a complex type like Array, and then this `TableSchema` is used through
`getResultSetSchema` to create the `resultRowSet`, how does the RowSet know
that we are in fact going to return String, and not an Array.
But it goes all the way down to Column in the constructed ColumnBasedSet in
https://github.com/apache/spark/blob/master/sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/Column.java#L123
that assumes String for any non-primitive type. (or to conversions in
ColumnValue for RowBasedSet in older protocol versions
https://github.com/apache/spark/blob/master/sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/ColumnValue.java#L198).
Now I understand. Thank you :+1:
----------------------------------------------------------------
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]