[GitHub] carbondata pull request #2687: [CARBONDATA-2876]Fix Avro decimal datatype wi...

classic Classic list List threaded Threaded
46 messages Options
123
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2687: [CARBONDATA-2876]Fix Avro decimal datatype wi...

qiuchenjian-2
GitHub user Indhumathi27 opened a pull request:

    https://github.com/apache/carbondata/pull/2687

    [CARBONDATA-2876]Fix Avro decimal datatype with precision and scale

    **What is PR for?**
   
    Add precision and scale for fieldvalue for Avro Decimal logical type
   
     - [ ] Any interfaces changed?
     
     - [ ] Any backward compatibility impacted?
     
     - [ ] Document update required?
   
     - [ ] Testing done
         
           
     - [ ] For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.
   


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/Indhumathi27/carbondata decimal_fix

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/carbondata/pull/2687.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2687
   
----
commit a6e5149c12a7427a00fdc634cd0d35aca077bbbb
Author: Indhumathi27 <indhumathim27@...>
Date:   2018-09-03T12:05:01Z

    Fix decimal type for Avro

----


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2687: [CARBONDATA-2876]Fix Avro decimal datatype with prec...

qiuchenjian-2
Github user Indhumathi27 commented on the issue:

    https://github.com/apache/carbondata/pull/2687
 
    Retest this please


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2687: [CARBONDATA-2876]Fix Avro decimal datatype with prec...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2687
 
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/8257/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2687: [CARBONDATA-2876]Fix Avro decimal datatype with prec...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2687
 
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/8260/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2687: [CARBONDATA-2876]Fix Avro decimal datatype with prec...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2687
 
    Build Success with Spark 2.2.1, Please check CI http://95.216.28.178:8080/job/ApacheCarbonPRBuilder1/189/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2687: [CARBONDATA-2876]Fix Avro decimal datatype wi...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user manishgupta88 commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2687#discussion_r214790148
 
    --- Diff: store/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java ---
    @@ -407,6 +413,19 @@ private Object avroFieldToObjectForUnionType(Schema avroField, Object fieldValue
               out = null;
             }
             break;
    +      case BYTES:
    +        // DECIMAL type is defined in Avro as a BYTE type with the logicalType property
    +        // set to "decimal" and a specified precision and scale
    +        // As binary type is not supported yet,value will be null
    +        if (logicalType instanceof LogicalTypes.Decimal) {
    +          BigDecimal decimalValue = new BigDecimal(new String(((ByteBuffer) fieldValue).array(),
    +              CarbonCommonConstants.DEFAULT_CHARSET_CLASS));
    +          out = (decimalValue.round(
    +              new MathContext(((LogicalTypes.Decimal) avroField.getLogicalType()).getPrecision())))
    +              .setScale(((LogicalTypes.Decimal) avroField.getLogicalType()).getScale(),
    +                  RoundingMode.HALF_UP);
    --- End diff --
   
    replace bigdecimal conversion with below code at all places in the code
    `BigDecimal bigDecimal = new BigDecimal(new String(((ByteBuffer) fieldValue).array(), CarbonCommonConstants.DEFAULT_CHARSET_CLASS)
            .setScale(dimension.getColumnSchema().getScale(), RoundingMode.HALF_UP);`


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2687: [CARBONDATA-2876]Fix Avro decimal datatype with prec...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2687
 
    Build Failed with Spark 2.2.1, Please check CI http://95.216.28.178:8080/job/ApacheCarbonPRBuilder1/227/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2687: [CARBONDATA-2876]Fix Avro decimal datatype with prec...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2687
 
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/8297/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2687: [CARBONDATA-2876]Fix Avro decimal datatype with prec...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2687
 
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder2.1/6/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2687: [CARBONDATA-2876]Fix Avro decimal datatype with prec...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2687
 
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder2.1/119/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2687: [CARBONDATA-2876]Fix Avro decimal datatype with prec...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2687
 
    Build Failed  with Spark 2.3.1, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder2.3/8357/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2687: [CARBONDATA-2876]Fix Avro decimal datatype with prec...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2687
 
    Build Failed with Spark 2.2.1, Please check CI http://95.216.28.178:8080/job/ApacheCarbonPRBuilder1/287/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2687: [CARBONDATA-2876]Fix Avro decimal datatype with prec...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2687
 
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder2.1/121/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2687: [CARBONDATA-2876]Fix Avro decimal datatype with prec...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2687
 
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder2.1/122/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2687: [CARBONDATA-2876]Fix Avro decimal datatype with prec...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2687
 
    Build Failed  with Spark 2.3.1, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder2.3/8360/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2687: [CARBONDATA-2876]Fix Avro decimal datatype with prec...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2687
 
    Build Success with Spark 2.2.1, Please check CI http://95.216.28.178:8080/job/ApacheCarbonPRBuilder1/290/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2687: [CARBONDATA-2876]Fix Avro decimal datatype with prec...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2687
 
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder2.1/138/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2687: [CARBONDATA-2876]Fix Avro decimal datatype with prec...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2687
 
    Build Success with Spark 2.2.1, Please check CI http://95.216.28.178:8080/job/ApacheCarbonPRBuilder1/306/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2687: [CARBONDATA-2876]Fix Avro decimal datatype with prec...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2687
 
    Build Failed  with Spark 2.3.1, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder2.3/8376/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2687: [CARBONDATA-2876]Fix Avro decimal datatype with prec...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2687
 
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder2.1/147/



---
123