sshkvar commented on a change in pull request #2757:
URL: https://github.com/apache/iceberg/pull/2757#discussion_r662038363
##########
File path: spark/src/main/java/org/apache/iceberg/spark/SparkUtil.java
##########
@@ -20,21 +20,38 @@
package org.apache.iceberg.spark;
import java.util.List;
+import java.util.Map;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.stream.Collectors;
import org.apache.iceberg.PartitionField;
import org.apache.iceberg.PartitionSpec;
+import org.apache.iceberg.Schema;
import org.apache.iceberg.Table;
import org.apache.iceberg.hadoop.HadoopFileIO;
import org.apache.iceberg.io.FileIO;
import org.apache.iceberg.relocated.com.google.common.base.Preconditions;
import org.apache.iceberg.transforms.Transform;
import org.apache.iceberg.transforms.UnknownTransform;
+import org.apache.iceberg.types.TypeUtil;
+import org.apache.iceberg.types.Types;
import org.apache.iceberg.util.Pair;
+import org.apache.spark.sql.RuntimeConfig;
import org.apache.spark.util.SerializableConfiguration;
public class SparkUtil {
+
+ public static final String
HANDLE_TIMESTAMP_WITHOUT_TIMEZONE_SESSION_PROPERTY =
+ "spark.sql.iceberg.convert-timestamp-without-timezone";
+ public static final String TIMESTAMP_WITHOUT_TIMEZONE_ERROR =
String.format("Cannot handle timestamp without" +
+ " timezone fields in Spark. Spark does not natively support this
type but if you would like to handle all" +
+ " timestamps as timestamp with timezone set '%s' to true. This will
not change the underlying values stored" +
+ " but will change their displayed values in Spark. For more
information please see" +
+ "
https://docs.databricks.com/spark/latest/dataframes-datasets/dates-timestamps.html#ansi-sql-and"
+
+ "-spark-sql-timestamps",
HANDLE_TIMESTAMP_WITHOUT_TIMEZONE_SESSION_PROPERTY);
+ public static final String READ_TIMESTAMP_AS_TIMESTAMP_WITHOUT_TIMEZONE =
Review comment:
Yeah, you are right.
`HANDLE_TIMESTAMP_WITHOUT_TIMEZONE` is responsible for allowing reading and
writing of timestamp types without timezone.
`USE_TIMESTAMP_WITHOUT_TIME_ZONE_IN_NEW_TABLES` is responsible for selecting
which type will be used in new tables `Types.TimestampType#withoutZone()` or
`Types.TimestampType#withZone()`
I changed variable names, looks more clear now from my point of view, but
please let me know if you want to change names to something else
--
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]