You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/06/18 13:24:46 UTC

[GitHub] [spark] younggyuchun opened a new pull request #28858: [WIP][SPARK-7101][SQL] support java.sql.Time

younggyuchun opened a new pull request #28858:
URL: https://github.com/apache/spark/pull/28858


   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
     2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
     4. Be sure to keep the PR description updated to reflect all changes.
     5. Please write your PR title to summarize what this PR proposes.
     6. If possible, provide a concise example to reproduce the issue for a faster review.
     7. If you want to add a new configuration, please read the guideline first for naming configurations in
        'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
   -->
   
   ### What changes were proposed in this pull request?
   This PR aims to support java.sql.Time with an associated TimeType. 
   <!--
   Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue. 
   If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
     1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
     2. If you fix some SQL features, you can provide some references of other DBMSes.
     3. If there is design documentation, please add the link.
     4. If there is a discussion in the mailing list, please add the link.
   -->
   
   
   ### Why are the changes needed?
   Several RDBMSes support the TIME data type. The TIME data type accepts time value; for example, 07:30:00.
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   
   
   ### Does this PR introduce _any_ user-facing change?
   No
   <!--
   Note that it means *any* user-facing change including all aspects such as the documentation fix.
   If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
   If possible, please also clarify if this is a user-facing change compared to the released Spark versions or within the unreleased branches such as master.
   If no, write 'No'.
   -->
   
   
   ### How was this patch tested?
   Pass the Jenkins
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   -->
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #28858: [WIP][SPARK-7101][SQL] support java.sql.Time

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #28858:
URL: https://github.com/apache/spark/pull/28858#issuecomment-646148381


   Test FAILed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/124223/
   Test FAILed.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] dongjoon-hyun commented on a change in pull request #28858: [WIP][SPARK-7101][SQL] support java.sql.Time

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #28858:
URL: https://github.com/apache/spark/pull/28858#discussion_r442329380



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/types/TimeType.scala
##########
@@ -0,0 +1,63 @@
+/*
+ * 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 scala.math.Ordering
+import scala.reflect.runtime.universe.typeTag
+
+import org.apache.spark.annotation.Stable
+
+/**
+ * The timestamp type represents a time instant in microsecond precision.
+ * Valid range is [0001-01-01T00:00:00.000000Z, 9999-12-31T23:59:59.999999Z] where
+ * the left/right-bound is a date and time of the proleptic Gregorian
+ * calendar in UTC+00:00.
+ *
+ * Please use the singleton `DataTypes.TimestampType` to refer the type.
+ * @since 3.1.0
+ */
+@Stable
+class TimeType private() extends AtomicType {
+  /**
+   * Internally, a timestamp is stored as the number of microseconds from
+   * the epoch of 1970-01-01T00:00:00.000000Z (UTC+00:00)
+   */
+  private[sql] type InternalType = Long
+
+  @transient private[sql] lazy val tag = typeTag[InternalType]
+
+  private[sql] val ordering = implicitly[Ordering[InternalType]]
+
+  /**
+   * The default size of a value of the TimeType is 8 bytes.
+   */
+  override def defaultSize: Int = 8
+
+  private[spark] override def asNullable: TimeType = this
+}
+
+/**
+ * The companion case object and its class is separated so the companion object also subclasses
+ * the TimestampType class. Otherwise, the companion object would be of type "TimestampType$"

Review comment:
       `TimestampType` -> `TimeType`?
   `TimestampType$` -> `TimeType$`?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #28858: [WIP][SPARK-7101][SQL] support java.sql.Time

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #28858:
URL: https://github.com/apache/spark/pull/28858#issuecomment-646147245


   **[Test build #124223 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/124223/testReport)** for PR 28858 at commit [`d172dd4`](https://github.com/apache/spark/commit/d172dd4f913127c81ae3d4ba39318449b11c75dc).


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #28858: [WIP][SPARK-7101][SQL] support java.sql.Time

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #28858:
URL: https://github.com/apache/spark/pull/28858#issuecomment-646148335


   **[Test build #124223 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/124223/testReport)** for PR 28858 at commit [`d172dd4`](https://github.com/apache/spark/commit/d172dd4f913127c81ae3d4ba39318449b11c75dc).
    * This patch **fails Scala style tests**.
    * This patch merges cleanly.
    * This patch adds the following public classes _(experimental)_:
     * `class SQLQueryTestSuite extends QueryTest with SharedSparkSession with SQLHelper `


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #28858: [WIP][SPARK-7101][SQL] support java.sql.Time

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #28858:
URL: https://github.com/apache/spark/pull/28858#issuecomment-646148139






----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #28858: [WIP][SPARK-7101][SQL] support java.sql.Time

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #28858:
URL: https://github.com/apache/spark/pull/28858#issuecomment-646115593


   **[Test build #124216 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/124216/testReport)** for PR 28858 at commit [`be53ff6`](https://github.com/apache/spark/commit/be53ff6b2fa829ffa3f0f4cc2996aa74fd7056c0).
    * This patch **fails Spark unit tests**.
    * This patch **does not merge cleanly**.
    * This patch adds the following public classes _(experimental)_:
     * `abstract class  CastBase extends UnaryExpression with TimeZoneAwareExpression with NullIntolerant `


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] dongjoon-hyun edited a comment on pull request #28858: [WIP][SPARK-7101][SQL] support java.sql.Time

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun edited a comment on pull request #28858:
URL: https://github.com/apache/spark/pull/28858#issuecomment-646895801


   Oh, right. This was tried by @MaxGekk before and concluded by the following comment by @rxin .
   - https://github.com/apache/spark/pull/25678#issuecomment-531585556


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #28858: [WIP][SPARK-7101][SQL] support java.sql.Time

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #28858:
URL: https://github.com/apache/spark/pull/28858#issuecomment-646116306


   Test FAILed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/124216/
   Test FAILed.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] younggyuchun edited a comment on pull request #28858: [WIP][SPARK-7101][SQL] support java.sql.Time

Posted by GitBox <gi...@apache.org>.
younggyuchun edited a comment on pull request #28858:
URL: https://github.com/apache/spark/pull/28858#issuecomment-647503789


   @dongjoon-hyun Thank you for your comment. Don't be sorry there are tons of work :). 
   should we close these tickets too?
   https://issues.apache.org/jira/browse/SPARK-27148
   https://issues.apache.org/jira/browse/SPARK-7101


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] younggyuchun closed pull request #28858: [WIP][SPARK-7101][SQL] support java.sql.Time

Posted by GitBox <gi...@apache.org>.
younggyuchun closed pull request #28858:
URL: https://github.com/apache/spark/pull/28858


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #28858: [WIP][SPARK-7101][SQL] support java.sql.Time

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #28858:
URL: https://github.com/apache/spark/pull/28858#issuecomment-646015508






----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] dongjoon-hyun commented on pull request #28858: [WIP][SPARK-7101][SQL] support java.sql.Time

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on pull request #28858:
URL: https://github.com/apache/spark/pull/28858#issuecomment-646895801


   Oh, right. This was tried by @MaxGekk before and concluded here by @rxin .
   - https://github.com/apache/spark/pull/25678#issuecomment-531585556


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] dongjoon-hyun commented on a change in pull request #28858: [WIP][SPARK-7101][SQL] support java.sql.Time

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #28858:
URL: https://github.com/apache/spark/pull/28858#discussion_r442330815



##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/encoders/RowEncoderSuite.scala
##########
@@ -83,20 +83,22 @@ class RowEncoderSuite extends CodegenInterpretedPlanTest {
 
   encodeDecodeTest(
     new StructType()
-      .add("null", NullType)
-      .add("boolean", BooleanType)
-      .add("byte", ByteType)
-      .add("short", ShortType)
-      .add("int", IntegerType)
-      .add("long", LongType)
-      .add("float", FloatType)
-      .add("double", DoubleType)
-      .add("decimal", DecimalType.SYSTEM_DEFAULT)
-      .add("string", StringType)
-      .add("binary", BinaryType)
-      .add("date", DateType)
-      .add("timestamp", TimestampType)
-      .add("udt", new ExamplePointUDT))
+//      .add("null", NullType)

Review comment:
       ? Please revert this commenting out.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on pull request #28858: [WIP][SPARK-7101][SQL] support java.sql.Time

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #28858:
URL: https://github.com/apache/spark/pull/28858#issuecomment-646018900


   **[Test build #124216 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/124216/testReport)** for PR 28858 at commit [`be53ff6`](https://github.com/apache/spark/commit/be53ff6b2fa829ffa3f0f4cc2996aa74fd7056c0).


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HyukjinKwon commented on a change in pull request #28858: [WIP][SPARK-7101][SQL] support java.sql.Time

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on a change in pull request #28858:
URL: https://github.com/apache/spark/pull/28858#discussion_r442765441



##########
File path: sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeRow.java
##########
@@ -90,7 +90,8 @@ public static int calculateBitSetWidthInBytes(int numFields) {
           FloatType,
           DoubleType,
           DateType,
-          TimestampType
+          TimestampType,
+          TimeType

Review comment:
       Problem is that you have to define the mapping for PySpark and SparkR too that's probably one of the tricky part.
   I think it's best to loop the dev mailing list and see if there's a big support for this. Otherwise, I'm not super supportive of it due to the maintenance cost.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] dongjoon-hyun edited a comment on pull request #28858: [WIP][SPARK-7101][SQL] support java.sql.Time

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun edited a comment on pull request #28858:
URL: https://github.com/apache/spark/pull/28858#issuecomment-646895801


   Oh, right. This was tried by @MaxGekk before and concluded by the following comment by @rxin .
   - https://github.com/apache/spark/pull/25678#issuecomment-531585556
   
   In this case, we had better close this.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #28858: [WIP][SPARK-7101][SQL] support java.sql.Time

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #28858:
URL: https://github.com/apache/spark/pull/28858#issuecomment-646015508






----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on pull request #28858: [WIP][SPARK-7101][SQL] support java.sql.Time

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #28858:
URL: https://github.com/apache/spark/pull/28858#issuecomment-646147245


   **[Test build #124223 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/124223/testReport)** for PR 28858 at commit [`d172dd4`](https://github.com/apache/spark/commit/d172dd4f913127c81ae3d4ba39318449b11c75dc).


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #28858: [WIP][SPARK-7101][SQL] support java.sql.Time

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #28858:
URL: https://github.com/apache/spark/pull/28858#issuecomment-646148139






----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #28858: [WIP][SPARK-7101][SQL] support java.sql.Time

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #28858:
URL: https://github.com/apache/spark/pull/28858#issuecomment-646116294


   Build finished. Test FAILed.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #28858: [WIP][SPARK-7101][SQL] support java.sql.Time

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #28858:
URL: https://github.com/apache/spark/pull/28858#issuecomment-646018900


   **[Test build #124216 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/124216/testReport)** for PR 28858 at commit [`be53ff6`](https://github.com/apache/spark/commit/be53ff6b2fa829ffa3f0f4cc2996aa74fd7056c0).


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] younggyuchun commented on pull request #28858: [WIP][SPARK-7101][SQL] support java.sql.Time

Posted by GitBox <gi...@apache.org>.
younggyuchun commented on pull request #28858:
URL: https://github.com/apache/spark/pull/28858#issuecomment-646704007


   > Please, take a look at #25678 and the reasons why I closed it.
   
   Hi @MaxGekk 
   Thank you for your comment. I haven't noticed that there was a discussion on TimeType. I read through #25678 but not sure if we should close this PR or not. Can you confirm that?
   
   CC @dongjoon-hyun @HyukjinKwon 


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] dongjoon-hyun commented on a change in pull request #28858: [WIP][SPARK-7101][SQL] support java.sql.Time

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #28858:
URL: https://github.com/apache/spark/pull/28858#discussion_r442328745



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/types/TimeType.scala
##########
@@ -0,0 +1,63 @@
+/*
+ * 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 scala.math.Ordering
+import scala.reflect.runtime.universe.typeTag
+
+import org.apache.spark.annotation.Stable
+
+/**
+ * The timestamp type represents a time instant in microsecond precision.
+ * Valid range is [0001-01-01T00:00:00.000000Z, 9999-12-31T23:59:59.999999Z] where
+ * the left/right-bound is a date and time of the proleptic Gregorian
+ * calendar in UTC+00:00.
+ *
+ * Please use the singleton `DataTypes.TimestampType` to refer the type.
+ * @since 3.1.0
+ */
+@Stable
+class TimeType private() extends AtomicType {
+  /**
+   * Internally, a timestamp is stored as the number of microseconds from

Review comment:
       `timestamp` -> `time`?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] dongjoon-hyun edited a comment on pull request #28858: [WIP][SPARK-7101][SQL] support java.sql.Time

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun edited a comment on pull request #28858:
URL: https://github.com/apache/spark/pull/28858#issuecomment-646895801


   Oh, right. This was tried by @MaxGekk before and concluded by the following comment by @rxin .
   - https://github.com/apache/spark/pull/25678#issuecomment-531585556
   
   In this case, we had better close this. Sorry about that, @younggyuchun .


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] younggyuchun commented on pull request #28858: [WIP][SPARK-7101][SQL] support java.sql.Time

Posted by GitBox <gi...@apache.org>.
younggyuchun commented on pull request #28858:
URL: https://github.com/apache/spark/pull/28858#issuecomment-647503789


   @dongjoon-hyun Thank you for your comment. Don't be sorry there are tons of work :). 
   I guess we should close this one too:
   https://issues.apache.org/jira/browse/SPARK-27148


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] dongjoon-hyun commented on pull request #28858: [WIP][SPARK-7101][SQL] support java.sql.Time

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on pull request #28858:
URL: https://github.com/apache/spark/pull/28858#issuecomment-647776516


   Thanks. Yes. +1 for closing them with this and previous reference.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #28858: [WIP][SPARK-7101][SQL] support java.sql.Time

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #28858:
URL: https://github.com/apache/spark/pull/28858#issuecomment-646116294






----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] dongjoon-hyun commented on a change in pull request #28858: [WIP][SPARK-7101][SQL] support java.sql.Time

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #28858:
URL: https://github.com/apache/spark/pull/28858#discussion_r442330503



##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/RandomDataGenerator.scala
##########
@@ -191,6 +191,22 @@ object RandomDataGenerator {
             DateTimeUtils.toJavaTimestamp(milliseconds * 1000)
           }
         Some(generator)
+      case TimeType =>
+        val generator =
+          () => {
+            var milliseconds = rand.nextLong() % 253402329599999L
+            // -62135740800000L is the number of milliseconds before January 1, 1970, 00:00:00 GMT
+            // for "0001-01-01 00:00:00.000000". We need to find a
+            // number that is greater or equals to this number as a valid timestamp value.
+            while (milliseconds < -62135740800000L) {
+              // 253402329599999L is the number of milliseconds since
+              // January 1, 1970, 00:00:00 GMT for "9999-12-31 23:59:59.999999".
+              milliseconds = rand.nextLong() % 253402329599999L
+            }
+            // DateTimeUtils.toJavaTime takes microsecond.

Review comment:
       `takes microsecond`? It seems that `milliseconds` is passed.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] younggyuchun commented on pull request #28858: [WIP][SPARK-7101][SQL] support java.sql.Time

Posted by GitBox <gi...@apache.org>.
younggyuchun commented on pull request #28858:
URL: https://github.com/apache/spark/pull/28858#issuecomment-646128615


   @dongjoon-hyun 
   I don't expect that someone will see WIP merge request :). Yeah, of course, I will fix the merge conflicts and issues. Thank you


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] dongjoon-hyun commented on pull request #28858: [WIP][SPARK-7101][SQL] support java.sql.Time

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on pull request #28858:
URL: https://github.com/apache/spark/pull/28858#issuecomment-647196491


   Gentle ping, @younggyuchun .


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #28858: [WIP][SPARK-7101][SQL] support java.sql.Time

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #28858:
URL: https://github.com/apache/spark/pull/28858#issuecomment-646148364






----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] dongjoon-hyun commented on pull request #28858: [WIP][SPARK-7101][SQL] support java.sql.Time

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on pull request #28858:
URL: https://github.com/apache/spark/pull/28858#issuecomment-646119450


   Hi, @younggyuchun . Could you resolve conflicts?


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org