stevomitric commented on code in PR #55952:
URL: https://github.com/apache/spark/pull/55952#discussion_r3272878399
##########
sql/api/src/main/scala/org/apache/spark/sql/errors/DataTypeErrors.scala:
##########
@@ -275,4 +275,18 @@ private[sql] object DataTypeErrors extends
DataTypeErrorsBase {
messageParameters = Map("precision" -> precision.toString),
cause = null)
}
+
+ def unsupportedTimestampNtzPrecisionError(precision: String): Throwable = {
Review Comment:
Why is precision a string here?
##########
sql/api/src/main/scala/org/apache/spark/sql/types/TimestampLTZNanosType.scala:
##########
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.sql.types
+
+import org.apache.spark.annotation.Unstable
+import org.apache.spark.sql.errors.DataTypeErrors
+
+/**
+ * Timestamp with local time zone with fractional-second precision in the
nanosecond-capable range
+ * (7 to 9 decimal digits). Represents a time instant analogous to
`TimestampType`, but with
+ * sub-microsecond precision: valid range is [0001-01-01T00:00:00.000000000Z,
+ * 9999-12-31T23:59:59.999999999Z] in the proleptic Gregorian calendar at
UTC+00:00. No time zone
+ * is stored; the session time zone is used when converting values to and from
text.
+ *
+ * @param precision
+ * Number of digits of fractional seconds for this SQL type. The valid
values are 7, 8, and 9
+ * where 9 means nanosecond precision.
+ *
+ * @since 4.2.0
+ */
+@Unstable
+case class TimestampLTZNanosType(precision: Int) extends DatetimeType {
Review Comment:
The current timestamp type doesn't include "LTZ" in the name. Why not go
with `TimestampNanosType` here?
--
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]