Skip to content

Commit

Permalink
Align the timezone of decimal partition value with Velox
Browse files Browse the repository at this point in the history
  • Loading branch information
rui-mo committed Nov 21, 2024
1 parent d5e5544 commit 0dcb881
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import org.apache.gluten.substrait.rel.{LocalFilesBuilder, LocalFilesNode, Split
import org.apache.gluten.substrait.rel.LocalFilesNode.ReadFileFormat
import org.apache.gluten.utils._
import org.apache.gluten.vectorized._

import org.apache.spark.{SparkConf, TaskContext}
import org.apache.spark.internal.Logging
import org.apache.spark.softaffinity.SoftAffinity
Expand All @@ -43,9 +42,8 @@ import org.apache.spark.util.{ExecutorManager, SparkDirectoryUtil}

import java.lang.{Long => JLong}
import java.nio.charset.StandardCharsets
import java.time.ZoneOffset
import java.util.{ArrayList => JArrayList, HashMap => JHashMap, Map => JMap, UUID}

import java.time.{ZoneId, ZoneOffset}
import java.util.{UUID, ArrayList => JArrayList, HashMap => JHashMap, Map => JMap}
import scala.collection.JavaConverters._

class VeloxIteratorApi extends IteratorApi with Logging {
Expand Down Expand Up @@ -151,8 +149,9 @@ class VeloxIteratorApi extends IteratorApi with Logging {
case _: DecimalType =>
pn.asInstanceOf[Decimal].toJavaBigInteger.toString
case _: TimestampType =>
// Velox uses 'America/Los_Angeles' timezone by default.
TimestampFormatter
.getFractionFormatter(ZoneOffset.UTC)
.getFractionFormatter(ZoneId.of("America/Los_Angeles"))
.format(pn.asInstanceOf[java.lang.Long])
case _ => pn.toString
}
Expand Down
4 changes: 2 additions & 2 deletions ep/build-velox/src/get_velox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

set -exu

VELOX_REPO=https://github.com/oap-project/velox.git
VELOX_BRANCH=2024_11_20
VELOX_REPO=https://github.com/rui-mo/velox.git
VELOX_BRANCH=test_tz
VELOX_HOME=""

OS=`uname -s`
Expand Down

0 comments on commit 0dcb881

Please sign in to comment.