### _Why are the changes needed?_ We met below issue when fetching result. ``` Caused by: java.lang.RuntimeException: java.lang.ArrayIndexOutOfBoundsException:46 7022 at sun.util.calendar.BaseCalendar.getCalendarDateFromFixedDate(BaseCalendar.java:453) 7023 at java.util.GregorianCalendar.computeFields(GregorianCalendar.java:2397) 7024 at java.util.GregorianCalendar.computeFields(GregorianCalendar.java:2312) 7025 at java.util.Calendar.setTimeInMillis(Calendar.java:1804) 7026 at java.util.Calendar.setTime(Calendar.java:1770) 7027 at java.text.SimpleDateFormat.format(SimpleDateFormat.java:943) 7028 at java.text.SimpleDateFormat.format(SimpleDateFormat.java:936) 7029 at java.text.DateFormat.format(DateFormat.java:345) 7030 at org.apache.kyuubi.schema.RowSet$.toHiveString(RowSet.scala:245) 7031 at org.apache.kyuubi.schema.RowSet$.$anonfun$toTColumn$3(RowSet.scala:120) 7032 at scala.collection.immutable.List.map(List.scala:290) 7033 at org.apache.kyuubi.schema.RowSet$.toTColumn(RowSet.scala:115) 7034 at org.apache.kyuubi.schema.RowSet$.$anonfun$toColumnBasedSet$1(RowSet.scala:65) 7035 at org.apache.kyuubi.schema.RowSet$.$anonfun$toColumnBasedSet$1$adapted(RowSet.scala:64) 7036 at scala.collection.immutable.List.foreach(List.scala:392) 7037 at org.apache.kyuubi.schema.RowSet$.toColumnBasedSet(RowSet.scala:64) 7038 at org.apache.kyuubi.schema.RowSet$.toTRowSet(RowSet.scala:47) 7039 at org.apache.kyuubi.engine.spark.operation.SparkOperation.getNextRowSet(SparkOperation.scala:183) 7040 at org.apache.kyuubi.operation.OperationManager.getOperationNextRowSet(OperationManager.scala:116) 7041 at org.apache.kyuubi.session.AbstractSession.fetchResults(AbstractSession.scala:197) 7042 at org.apache.kyuubi.service.AbstractBackendService.fetchResults(AbstractBackendService.scala:169) 7043 at org.apache.kyuubi.service.ThriftBinaryFrontendService.FetchResults(ThriftBinaryFrontendService.scala:505) ``` The root cause is that the date time formatter used to convert the result to rowSet is not thread-safe. In this pr, we use thread-safe FastDateFormat instead of SimpleDateFormat. ### _How was this patch tested?_ Existing UT. Closes #2075 from turboFei/thread_safe_fat_stimeformatter. Closes #2075 44ae8fd1 [Fei Wang] Using thread-safe FastDateFormat instead of SimpleDateFormat Authored-by: Fei Wang <fwang12@ebay.com> Signed-off-by: Kent Yao <yao@apache.org> |
||
|---|---|---|
| .. | ||
| kyuubi-download | ||
| kyuubi-flink-sql-engine | ||
| kyuubi-hive-sql-engine | ||
| kyuubi-spark-sql-engine | ||
| kyuubi-trino-engine | ||