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 2022/11/03 15:31:29 UTC

[GitHub] [spark] dfit99 opened a new pull request, #38500: [SPARK-41007][SQL] Add missing serializer for java.math.BigInteger

dfit99 opened a new pull request, #38500:
URL: https://github.com/apache/spark/pull/38500

   <!--
   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'.
     8. If you want to add or modify an error type or message, please read the guideline first in
        'core/src/main/resources/error/README.md'.
   -->
   
   ### What changes were proposed in this pull request?
   <!--
   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.
   -->
   
   The JavaTypeInference class used by the [Bean Encoder](https://spark.apache.org/docs/3.2.0/api/java/org/apache/spark/sql/Encoders.html#bean-java.lang.Class-) to create
   serialize/deserialize a Java Bean was missing a case statement to serialize java.math.BigInteger. This adds the missing case statement.
   
   
   ### Why are the changes needed?
   <!--
   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.
   -->
   
   This fixes the bug mentioned in the description
   
   ### Does this PR introduce _any_ user-facing change?
   <!--
   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'.
   -->
   No.
   
   
   ### How was this patch tested?
   <!--
   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.
   If benchmark tests were added, please run the benchmarks in GitHub Actions for the consistent environment, and the instructions could accord to: https://spark.apache.org/developer-tools.html#github-workflow-benchmarks.
   -->
   - Unit Test
   - Manually tested creating a new dataset with a Java Bean containing a java.math.BigInteger field
   


-- 
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: reviews-unsubscribe@spark.apache.org

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] srowen commented on a diff in pull request #38500: [SPARK-41007][SQL] Add missing serializer for java.math.BigInteger

Posted by GitBox <gi...@apache.org>.
srowen commented on code in PR #38500:
URL: https://github.com/apache/spark/pull/38500#discussion_r1014673309


##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/JavaTypeInferenceSuite.scala:
##########
@@ -0,0 +1,41 @@
+/*
+ * 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.catalyst
+
+import java.math.BigInteger
+
+import scala.beans.BeanProperty
+
+import org.apache.spark.SparkFunSuite
+import org.apache.spark.sql.catalyst.expressions.{CheckOverflow, Expression, Literal}
+import org.apache.spark.sql.types.DecimalType
+
+class DummyBean(@BeanProperty var bigInteger: BigInteger) {
+}
+
+class JavaTypeInferenceSuite extends SparkFunSuite {

Review Comment:
   I guess we don't have a test suite for this. I think it's not terrible to add it; ideally we'd also add other simple tests here. Or skip it. I'm fine with any.



-- 
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: reviews-unsubscribe@spark.apache.org

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] dfit99 commented on a diff in pull request #38500: [SPARK-41007][SQL] Add missing serializer for java.math.BigInteger

Posted by GitBox <gi...@apache.org>.
dfit99 commented on code in PR #38500:
URL: https://github.com/apache/spark/pull/38500#discussion_r1015904879


##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/JavaTypeInferenceSuite.scala:
##########
@@ -0,0 +1,41 @@
+/*
+ * 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.catalyst
+
+import java.math.BigInteger
+
+import scala.beans.BeanProperty
+
+import org.apache.spark.SparkFunSuite
+import org.apache.spark.sql.catalyst.expressions.{CheckOverflow, Expression, Literal}
+import org.apache.spark.sql.types.DecimalType
+
+class DummyBean(@BeanProperty var bigInteger: BigInteger) {
+}
+
+class JavaTypeInferenceSuite extends SparkFunSuite {

Review Comment:
   @dongjoon-hyun  @srowen  Anything else I can do here? I prefer to keep the JavaTypeInferenceSuite  here and add tests over time to it. 



-- 
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: reviews-unsubscribe@spark.apache.org

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] srowen commented on pull request #38500: [SPARK-41007][SQL] Add missing serializer for java.math.BigInteger

Posted by GitBox <gi...@apache.org>.
srowen commented on PR #38500:
URL: https://github.com/apache/spark/pull/38500#issuecomment-1306486464

   Merged to master


-- 
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: reviews-unsubscribe@spark.apache.org

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] dfit99 commented on a diff in pull request #38500: [SPARK-41007][SQL] Add missing serializer for java.math.BigInteger

Posted by GitBox <gi...@apache.org>.
dfit99 commented on code in PR #38500:
URL: https://github.com/apache/spark/pull/38500#discussion_r1013198652


##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/JavaTypeInferenceSuite.scala:
##########
@@ -0,0 +1,41 @@
+/*
+ * 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.catalyst
+
+import java.math.BigInteger
+
+import scala.beans.BeanProperty
+
+import org.apache.spark.SparkFunSuite
+import org.apache.spark.sql.catalyst.expressions.{CheckOverflow, Expression, Literal}
+import org.apache.spark.sql.types.DecimalType
+
+class DummyBean(@BeanProperty var bigInteger: BigInteger) {
+}
+
+class JavaTypeInferenceSuite extends SparkFunSuite {

Review Comment:
   where do I suggest you put the test case?



##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/JavaTypeInferenceSuite.scala:
##########
@@ -0,0 +1,41 @@
+/*
+ * 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.catalyst
+
+import java.math.BigInteger
+
+import scala.beans.BeanProperty
+
+import org.apache.spark.SparkFunSuite
+import org.apache.spark.sql.catalyst.expressions.{CheckOverflow, Expression, Literal}
+import org.apache.spark.sql.types.DecimalType
+
+class DummyBean(@BeanProperty var bigInteger: BigInteger) {
+}
+
+class JavaTypeInferenceSuite extends SparkFunSuite {

Review Comment:
   where do I suggest I put the test case?



-- 
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: reviews-unsubscribe@spark.apache.org

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 diff in pull request #38500: [SPARK-41007][SQL] Add missing serializer for java.math.BigInteger

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on code in PR #38500:
URL: https://github.com/apache/spark/pull/38500#discussion_r1013195700


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/JavaTypeInference.scala:
##########
@@ -434,6 +434,8 @@ object JavaTypeInference {
         case c if c == classOf[java.lang.Long] => createSerializerForLong(inputObject)
         case c if c == classOf[java.lang.Float] => createSerializerForFloat(inputObject)
         case c if c == classOf[java.lang.Double] => createSerializerForDouble(inputObject)
+        case c if c == classOf[java.math.BigInteger] =>
+          createSerializerForJavaBigInteger(inputObject)

Review Comment:
   ```scala
           case c if c == classOf[java.math.BigInteger] =>
              createSerializerForJavaBigInteger(inputObject)
   
           case c if c == classOf[java.math.BigDecimal] =>
             createSerializerForJavaBigDecimal(inputObject)
   ```



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/JavaTypeInference.scala:
##########
@@ -434,6 +434,8 @@ object JavaTypeInference {
         case c if c == classOf[java.lang.Long] => createSerializerForLong(inputObject)
         case c if c == classOf[java.lang.Float] => createSerializerForFloat(inputObject)
         case c if c == classOf[java.lang.Double] => createSerializerForDouble(inputObject)
+        case c if c == classOf[java.math.BigInteger] =>
+          createSerializerForJavaBigInteger(inputObject)

Review Comment:
   BTW, could you move this before line 427 (java.math.BigDecimal) case?



-- 
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: reviews-unsubscribe@spark.apache.org

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 diff in pull request #38500: [SPARK-41007][SQL] Add missing serializer for java.math.BigInteger

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on code in PR #38500:
URL: https://github.com/apache/spark/pull/38500#discussion_r1013194781


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/JavaTypeInference.scala:
##########
@@ -434,6 +434,8 @@ object JavaTypeInference {
         case c if c == classOf[java.lang.Long] => createSerializerForLong(inputObject)
         case c if c == classOf[java.lang.Float] => createSerializerForFloat(inputObject)
         case c if c == classOf[java.lang.Double] => createSerializerForDouble(inputObject)
+        case c if c == classOf[java.math.BigInteger] =>
+          createSerializerForJavaBigInteger(inputObject)

Review Comment:
   BTW, could you move this to line 428 (java.math.BigDecimal) case?



-- 
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: reviews-unsubscribe@spark.apache.org

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] srowen commented on a diff in pull request #38500: [SPARK-41007][SQL] Add missing serializer for java.math.BigInteger

Posted by GitBox <gi...@apache.org>.
srowen commented on code in PR #38500:
URL: https://github.com/apache/spark/pull/38500#discussion_r1015940334


##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/JavaTypeInferenceSuite.scala:
##########
@@ -0,0 +1,41 @@
+/*
+ * 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.catalyst
+
+import java.math.BigInteger
+
+import scala.beans.BeanProperty
+
+import org.apache.spark.SparkFunSuite
+import org.apache.spark.sql.catalyst.expressions.{CheckOverflow, Expression, Literal}
+import org.apache.spark.sql.types.DecimalType
+
+class DummyBean(@BeanProperty var bigInteger: BigInteger) {
+}
+
+class JavaTypeInferenceSuite extends SparkFunSuite {

Review Comment:
   I'll merge shortly if there are no objections. I think it's OK as an improvement, don't see any downside



-- 
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: reviews-unsubscribe@spark.apache.org

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 diff in pull request #38500: [SPARK-41007][SQL] Add missing serializer for java.math.BigInteger

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on code in PR #38500:
URL: https://github.com/apache/spark/pull/38500#discussion_r1013195700


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/JavaTypeInference.scala:
##########
@@ -434,6 +434,8 @@ object JavaTypeInference {
         case c if c == classOf[java.lang.Long] => createSerializerForLong(inputObject)
         case c if c == classOf[java.lang.Float] => createSerializerForFloat(inputObject)
         case c if c == classOf[java.lang.Double] => createSerializerForDouble(inputObject)
+        case c if c == classOf[java.math.BigInteger] =>
+          createSerializerForJavaBigInteger(inputObject)

Review Comment:
   ```scala
           case c if c == classOf[java.math.BigDecimal] =>
             createSerializerForJavaBigDecimal(inputObject)
   
           case c if c == classOf[java.math.BigInteger] =>
              createSerializerForJavaBigInteger(inputObject)
   ```



-- 
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: reviews-unsubscribe@spark.apache.org

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 diff in pull request #38500: [SPARK-41007][SQL] Add missing serializer for java.math.BigInteger

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on code in PR #38500:
URL: https://github.com/apache/spark/pull/38500#discussion_r1013185828


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/JavaTypeInference.scala:
##########
@@ -434,6 +434,8 @@ object JavaTypeInference {
         case c if c == classOf[java.lang.Long] => createSerializerForLong(inputObject)
         case c if c == classOf[java.lang.Float] => createSerializerForFloat(inputObject)
         case c if c == classOf[java.lang.Double] => createSerializerForDouble(inputObject)
+        case c if c == classOf[java.math.BigInteger]
+        => createSerializerForJavaBigInteger(inputObject)

Review Comment:
   Indentation?



-- 
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: reviews-unsubscribe@spark.apache.org

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] srowen closed pull request #38500: [SPARK-41007][SQL] Add missing serializer for java.math.BigInteger

Posted by GitBox <gi...@apache.org>.
srowen closed pull request #38500: [SPARK-41007][SQL] Add missing serializer for java.math.BigInteger 
URL: https://github.com/apache/spark/pull/38500


-- 
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: reviews-unsubscribe@spark.apache.org

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] dfit99 commented on a diff in pull request #38500: [SPARK-41007][SQL] Add missing serializer for java.math.BigInteger

Posted by GitBox <gi...@apache.org>.
dfit99 commented on code in PR #38500:
URL: https://github.com/apache/spark/pull/38500#discussion_r1013198652


##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/JavaTypeInferenceSuite.scala:
##########
@@ -0,0 +1,41 @@
+/*
+ * 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.catalyst
+
+import java.math.BigInteger
+
+import scala.beans.BeanProperty
+
+import org.apache.spark.SparkFunSuite
+import org.apache.spark.sql.catalyst.expressions.{CheckOverflow, Expression, Literal}
+import org.apache.spark.sql.types.DecimalType
+
+class DummyBean(@BeanProperty var bigInteger: BigInteger) {
+}
+
+class JavaTypeInferenceSuite extends SparkFunSuite {

Review Comment:
   where do you suggest I put the test case?



-- 
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: reviews-unsubscribe@spark.apache.org

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] dfit99 commented on a diff in pull request #38500: [SPARK-41007][SQL] Add missing serializer for java.math.BigInteger

Posted by GitBox <gi...@apache.org>.
dfit99 commented on code in PR #38500:
URL: https://github.com/apache/spark/pull/38500#discussion_r1013199896


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/JavaTypeInference.scala:
##########
@@ -434,6 +434,8 @@ object JavaTypeInference {
         case c if c == classOf[java.lang.Long] => createSerializerForLong(inputObject)
         case c if c == classOf[java.lang.Float] => createSerializerForFloat(inputObject)
         case c if c == classOf[java.lang.Double] => createSerializerForDouble(inputObject)
+        case c if c == classOf[java.math.BigInteger] =>
+          createSerializerForJavaBigInteger(inputObject)

Review Comment:
   will do



-- 
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: reviews-unsubscribe@spark.apache.org

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] dfit99 commented on a diff in pull request #38500: [SPARK-41007][SQL] Add missing serializer for java.math.BigInteger

Posted by GitBox <gi...@apache.org>.
dfit99 commented on code in PR #38500:
URL: https://github.com/apache/spark/pull/38500#discussion_r1015904879


##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/JavaTypeInferenceSuite.scala:
##########
@@ -0,0 +1,41 @@
+/*
+ * 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.catalyst
+
+import java.math.BigInteger
+
+import scala.beans.BeanProperty
+
+import org.apache.spark.SparkFunSuite
+import org.apache.spark.sql.catalyst.expressions.{CheckOverflow, Expression, Literal}
+import org.apache.spark.sql.types.DecimalType
+
+class DummyBean(@BeanProperty var bigInteger: BigInteger) {
+}
+
+class JavaTypeInferenceSuite extends SparkFunSuite {

Review Comment:
   @dongjoon-hyun  @srowen  Anything else I can do here to get this is merged in? I prefer to keep the JavaTypeInferenceSuite  here and add tests over time to it. 



-- 
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: reviews-unsubscribe@spark.apache.org

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 diff in pull request #38500: [SPARK-41007][SQL] Add missing serializer for java.math.BigInteger

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on code in PR #38500:
URL: https://github.com/apache/spark/pull/38500#discussion_r1016025575


##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/JavaTypeInferenceSuite.scala:
##########
@@ -0,0 +1,41 @@
+/*
+ * 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.catalyst
+
+import java.math.BigInteger
+
+import scala.beans.BeanProperty
+
+import org.apache.spark.SparkFunSuite
+import org.apache.spark.sql.catalyst.expressions.{CheckOverflow, Expression, Literal}
+import org.apache.spark.sql.types.DecimalType
+
+class DummyBean(@BeanProperty var bigInteger: BigInteger) {
+}
+
+class JavaTypeInferenceSuite extends SparkFunSuite {

Review Comment:
   +1 for @srowen 's comment.



-- 
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: reviews-unsubscribe@spark.apache.org

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 #38500: [SPARK-41007][SQL] Add missing serializer for java.math.BigInteger

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

   Can one of the admins verify this patch?


-- 
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: reviews-unsubscribe@spark.apache.org

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 diff in pull request #38500: [SPARK-41007][SQL] Add missing serializer for java.math.BigInteger

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on code in PR #38500:
URL: https://github.com/apache/spark/pull/38500#discussion_r1013190211


##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/JavaTypeInferenceSuite.scala:
##########
@@ -0,0 +1,41 @@
+/*
+ * 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.catalyst
+
+import java.math.BigInteger
+
+import scala.beans.BeanProperty
+
+import org.apache.spark.SparkFunSuite
+import org.apache.spark.sql.catalyst.expressions.{CheckOverflow, Expression, Literal}
+import org.apache.spark.sql.types.DecimalType
+
+class DummyBean(@BeanProperty var bigInteger: BigInteger) {
+}
+
+class JavaTypeInferenceSuite extends SparkFunSuite {

Review Comment:
   Although we don't have this test suite, is this inevitable? It seems like an overkill for a single simple test case.



-- 
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: reviews-unsubscribe@spark.apache.org

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