wangyum commented on PR #47699:
URL: https://github.com/apache/spark/pull/47699#issuecomment-2282642181
Another test:
```scala
import org.apache.hive.service.rpc.thrift.TProtocolVersion
import org.apache.spark.sql.execution.HiveResult
val df = spark.sql("select id, cast(id as string), cast(id as timestamp),
cast(id as decimal(18, 0)) from range(20000000)")
val dataTypes = df.schema.fields.map(_.dataType)
val rows = df.collect().toList
val start1 = System.currentTimeMillis()
RowSetUtils.toTRowSet(1, rows, dataTypes,
TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V11,
HiveResult.getTimeFormatters)
val start2 = System.currentTimeMillis()
RowSetUtils.toTRowSet(1, rows, dataTypes,
TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V5,
HiveResult.getTimeFormatters)
val start3 = System.currentTimeMillis()
println(s"toColumnBasedSet time: ${start2 - start1}, toRowBasedSet time:
${start3 - start2}")
```
Result:
```
toColumnBasedSet time: 40678, toRowBasedSet time: 90844
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]