Uh oh!
There was an error while loading. Please reload this page.
[SPARK-11827] [SQL] Adding java.math.BigInteger support in Java type inference for POJOs and Java collections - #10125
[SPARK-11827] [SQL] Adding java.math.BigInteger support in Java type inference for POJOs and Java collections#10125kevinyu98 wants to merge 26 commits into
Conversation
srowen
commented
Dec 3, 2015
@kevinyu98 please write a meaningful title and description. |
kevinyu98
commented
Dec 3, 2015
Hello Sean: I am sorry, I forgot to update the title and description. I have made the changes, please let me know if anything needs to be changed. Thanks. |
andrewor14
commented
Dec 15, 2015
SparkQA
commented
Dec 15, 2015
Test build #47689 has finished for PR 10125 at commit
|
There was a problem hiding this comment.
should we support both java and scala big integer?
There was a problem hiding this comment.
Hi Wenchen: Sure, I will add that.
get latest code from upstream
adding trim characters support
get latest code for pr12646
merge latest code
merge upstream/master
srowen
commented
May 6, 2016
Ping @kevinyu98 -- update the PR or close it? |
kevinyu98
commented
May 6, 2016
@srowen: sorry for the long delay. I will work on it now. |
1f77804 to
ae0be70Compare| case class ReflectData3( | ||
| scalaBigInt: scala.math.BigInt | ||
| ) |
There was a problem hiding this comment.
can you move this to a single line.
There was a problem hiding this comment.
I just removed that code.
kevinyu98
commented
May 13, 2016
@srowen@davies@cloud-fan I updated the code, can you help review? Sorry for the delay. Thanks. |
SparkQA
commented
May 13, 2016
Test build #58587 has finished for PR 10125 at commit
|
kevinyu98
commented
May 13, 2016
I just run the ./dev/mima locally, it works, |
kevinyu98
commented
May 13, 2016
retest it please. |
SparkQA
commented
May 18, 2016
Test build #58754 has finished for PR 10125 at commit
|
kevinyu98
commented
May 18, 2016
@cloud-fan can you help take a look? I have made changes based on your comments. Thanks. |
| val decimal = scalaValue match { | ||
| case d: BigDecimal => Decimal(d) | ||
| case d: JavaBigDecimal => Decimal(d) | ||
| case d: JavaBigInteger => Decimal(d) |
There was a problem hiding this comment.
Can you hold on until #13008? Then we can revert this change as CatalystTypeConverter is not used when creating DataFrame.
kevinyu98
commented
May 18, 2016
sure, I will do that. |
cloud-fan
commented
May 19, 2016
#13008 is merged, can you revert the |
kevinyu98
commented
May 19, 2016
@cloud-fan I tried, and it still fail. It didn't go through the createDataFrame you added in SparkSession. the beanToRows will create internal rows and it is from SQLContext. Should we add RowEncoder into the beansToRows call or leave the code as it is ? Thanks. here is the trace scala.MatchError: 1234567 (of class java.math.BigInteger) |
| val MAX_SCALE = 38 | ||
| val SYSTEM_DEFAULT: DecimalType = DecimalType(MAX_PRECISION, 18) | ||
| val USER_DEFAULT: DecimalType = DecimalType(10, 0) | ||
| val BIGINT_DEFAULT: DecimalType = DecimalType(MAX_PRECISION, 0) |
There was a problem hiding this comment.
please add a private[sql] val BigIntDecimal = DecimalType(38, 0) to the next section, instead of doing this.
kevinyu98
commented
May 19, 2016
retest it please. |
| Row first = df.select("a", "b", "c", "d").first(); | ||
| Assert.assertEquals(new StructField("e", DataTypes.createDecimalType(38,0), true, Metadata.empty()), | ||
| schema.apply("e")); | ||
| Row first = df.select("a", "b", "c", "d","e").first(); |
cloud-fan
commented
May 19, 2016
mostly LGTM, pending jenkins. |
kevinyu98
commented
May 19, 2016
I will push the latest one after jenkins finish. Thanks very much ! |
SparkQA
commented
May 19, 2016
Test build #58869 has finished for PR 10125 at commit
|
SparkQA
commented
May 19, 2016
Test build #58872 has finished for PR 10125 at commit
|
…nference for POJOs and Java collections Hello : Can you help check this PR? I am adding support for the java.math.BigInteger for java bean code path. I saw internally spark is converting the BigInteger to BigDecimal in ColumnType.scala and CatalystRowConverter.scala. I use the similar way and convert the BigInteger to the BigDecimal. . Author: Kevin Yu <qyu@us.ibm.com> Closes#10125 from kevinyu98/working_on_spark-11827. (cherry picked from commit 17591d9) Signed-off-by: Wenchen Fan <wenchen@databricks.com>
cloud-fan
commented
May 20, 2016
thanks, merging to master and 2.0! |
tedyu
commented
May 20, 2016
This seems to have broken build for Java 7: |
tedyu
commented
May 20, 2016
Looks like bigintval.longValue() should have been used. |
tedyu
commented
May 20, 2016
See #13233 |
tedyu
commented
May 21, 2016
When would the addendum be checked in ? For people using Java 7, it is inconvenient because they have to modify Decimal.scala otherwise the compilation would fail. |
Hello : Can you help check this PR? I am adding support for the java.math.BigInteger for java bean code path. I saw internally spark is converting the BigInteger to BigDecimal in ColumnType.scala and CatalystRowConverter.scala. I use the similar way and convert the BigInteger to the BigDecimal. .