Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-9288

[C++][Dataset] Discovery of partition field as dictionary type segfaulting with HivePartitioning

    XMLWordPrintableJSON

Details

    Description

      Testing new feature from ARROW-8647, python test that reproduces it:

      @pytest.mark.parquet
      @pytest.mark.parametrize('partitioning', ["directory", "hive"])
      def test_open_dataset_partitioned_dictionary_type(tempdir, partitioning):
          import pyarrow.parquet as pq
          table = pa.table({'a': range(9), 'b': [0.] * 4 + [1.] * 5})
      
          path = tempdir / "dataset"
          path.mkdir()
      
          for part in ["A", "B", "C"]:
              fmt = "{}" if partitioning == "directory" else "part={}"
              part = path / fmt.format(part)
              part.mkdir()
              pq.write_table(table, part / "test.parquet")
      
          if partitioning == "directory":
              part = ds.DirectoryPartitioning.discover(["part"], max_partition_dictionary_size=-1)
          else:
              part = ds.HivePartitioning.discover(max_partition_dictionary_size=-1)
          
          dataset = ds.dataset(str(path), partitioning=part)
          expected_schema = table.schema.append(
              pa.field("part", pa.dictionary(pa.int32(), pa.string()))
          )
          assert dataset.schema.equals(expected_schema)
      

      This test fails (segfaults) for HivePartitioning, but works for DirectoryPartitioning

      Attachments

        Issue Links

          Activity

            People

              jorisvandenbossche Joris Van den Bossche
              jorisvandenbossche Joris Van den Bossche
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 20m
                  1h 20m