You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2021/06/29 14:29:50 UTC
[GitHub] [iceberg] RussellSpitzer commented on a change in pull request #2757: Add support for reading/writing timestamps without timezone.
RussellSpitzer commented on a change in pull request #2757:
URL: https://github.com/apache/iceberg/pull/2757#discussion_r660676036
##########
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:
I still think we only really need one property, I think we should just use "handle" for both reading and writing
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org