Add jsonPath function length() to Parquet

This commit is contained in:
frank chen 2021-06-18 11:31:12 +08:00
parent d4b1ea4668
commit 5fa7412c7a
3 changed files with 7 additions and 1 deletions

View File

@ -46,6 +46,11 @@
"type": "path",
"name": "list",
"expr": "$.listDim"
},
{
"type": "path",
"name": "listLength",
"expr": "$.listDim.length()"
}
]
},

View File

@ -191,7 +191,7 @@ public class ParquetGroupJsonProvider implements JsonProvider
@Override
public Object unwrap(final Object o)
{
throw new UnsupportedOperationException("Unused");
return o;
}
}

View File

@ -116,6 +116,7 @@ public class FlattenSpecParquetInputTest extends BaseParquetInputTest
Assert.assertEquals("1", rows.get(0).getDimension("dim3").get(0));
Assert.assertEquals("listDim1v1", rows.get(0).getDimension("list").get(0));
Assert.assertEquals("listDim1v2", rows.get(0).getDimension("list").get(1));
Assert.assertEquals("2", rows.get(0).getDimension("listLength").get(0));
Assert.assertEquals(1, rows.get(0).getMetric("metric1").longValue());
}