Uploaded image for project: 'ORC'
  1. ORC
  2. ORC-198

Decimal types created with convert command generates IllegalArgumentException for valid documents

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.5.0
    • 1.4.1, 1.5.0
    • Java
    • None

    Description

      Using the command (sample payload attached):
      java -jar orc-tools-1.5.0-SNAPSHOT-uber.jar convert ~/example-v1.json

      throws exception:
      Scanning /home/shh/example-v1.json for schema
      Exception in thread "main" java.lang.IllegalArgumentException: precision 8 is out of range 1 .. 10
      at org.apache.orc.TypeDescription.withPrecision(TypeDescription.java:418)
      at org.apache.orc.tools.json.NumericType.getSchema(NumericType.java:105)
      at org.apache.orc.tools.json.StructType.getSchema(StructType.java:110)
      at org.apache.orc.tools.json.JsonSchemaFinder.getSchema(JsonSchemaFinder.java:257)
      at org.apache.orc.tools.convert.ConvertTool.computeSchema(ConvertTool.java:48)
      at org.apache.orc.tools.convert.ConvertTool.main(ConvertTool.java:58)
      at org.apache.orc.tools.Driver.main(Driver.java:112)

      Because org/apache/orc/tools/json/NumericType,getSchema() method incorrectly calls .withPrecision() before .withScale()

      Pull request incoming

      Attachments

        1. example-v1.json
          1 kB
          Shawn Hooton

        Issue Links

          Activity

            People

              codingogre Shawn Hooton
              codingogre Shawn Hooton
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: