Uploaded image for project: 'Parquet'
  1. Parquet
  2. PARQUET-379

PrimitiveType.union erases original type

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.5.0, 1.6.0, 1.7.0, 1.8.0
    • 1.9.0
    • parquet-mr
    • None

    Description

      The following ScalaTest test case

        test("merge primitive types") {
          val expected =
            Types.buildMessage()
              .addField(
                Types
                  .required(INT32)
                  .as(DECIMAL)
                  .precision(7)
                  .scale(2)
                  .named("f"))
              .named("root")
      
          assert(expected.union(expected) === expected)
        }
      

      produces the following assertion error

      message root {
        required int32 f;
      }
       did not equal message root {
        required int32 f (DECIMAL(9,0));
      }
      

      This is because PrimitiveType.union doesn't handle original type properly. An open question is that, can two primitive types with the same primitive type name but different original types be unioned?

      Attachments

        Issue Links

          Activity

            People

              lian cheng Cheng Lian
              lian cheng Cheng Lian
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: