etseidl commented on code in PR #7769:
URL: https://github.com/apache/arrow-rs/pull/7769#discussion_r2164449050
##########
parquet/src/record/reader.rs:
##########
@@ -1259,6 +1255,99 @@ mod tests {
assert_eq!(rows, expected_rows);
}
+ #[test]
+ fn test_file_reader_rows_nullable1() {
Review Comment:
A more descriptive name here would be nice...`test_compound_map_key` perhaps?
##########
parquet/src/record/reader.rs:
##########
@@ -1259,6 +1255,99 @@ mod tests {
assert_eq!(rows, expected_rows);
}
+ #[test]
+ fn test_file_reader_rows_nullable1() {
+ let rows = test_file_reader_rows("databricks.parquet", None).unwrap();
+ let expected_rows = vec![row![
+ ("bigint".to_string(), Field::Long(42)),
+ ("binary".to_string(), Field::Bytes(ByteArray::from("Spark"))),
+ ("boolean".to_string(), Field::Bool(true)),
+ ("boolean_null".to_string(), Field::Null),
+ ("date_zero".to_string(), Field::Date(-719530)),
+ ("date".to_string(), Field::Date(20236)),
+ (
+ "decimal".to_string(),
+ Field::Decimal(Decimal::Int64 {
+ value: [0, 0, 0, 0, 0, 0, 0, 5],
+ precision: 10,
+ scale: 0,
+ })
+ ),
+ (
+ "decimal3".to_string(),
+ Field::Decimal(Decimal::Int32 {
+ value: [0, 0, 0, 5],
+ precision: 3,
+ scale: 0,
+ })
+ ),
+ (
+ "decimal32".to_string(),
+ Field::Decimal(Decimal::Int32 {
+ value: [0, 0, 2, 23],
+ precision: 3,
+ scale: 2,
+ })
+ ),
+ ("double".to_string(), Field::Double(4.2)),
+ ("float".to_string(), Field::Float(4.2)),
+ ("int".to_string(), Field::Int(42)),
+ ("smallint".to_string(), Field::Short(1)),
+ ("string".to_string(), Field::Str("Spark".to_string())),
+ (
+ "timestamp".to_string(),
+ Field::TimestampMillis(1748390400000)
+ ),
+ (
+ "timestamp_tz".to_string(),
+ Field::TimestampMillis(1625118208000)
+ ),
+ (
+ "timestamp_ntz".to_string(),
+ Field::TimestampMicros(1748434348000000)
+ ),
+ (
+ "timestamp_ntz_nanos".to_string(),
+ Field::TimestampMicros(1748434348123456)
+ ),
+ ("tinyint".to_string(), Field::Byte(1)),
+ (
+ "array".to_string(),
+ list![Field::Int(1), Field::Int(2), Field::Int(3)]
+ ),
+ (
+ "nested_array".to_string(),
+ list![
+ list![Field::Long(1), Field::Long(2)],
+ list![Field::Long(3), Field::Long(4)]
+ ]
+ ),
+ (
+ "struct".to_string(),
+ group![
+ ("col1".to_string(), Field::Str("Spark".to_string())),
+ ("col2".to_string(), Field::Int(5))
+ ]
+ ),
+ (
+ "map".to_string(),
+ map![
+ (Field::Str("red".to_string()), Field::Int(1)),
+ (Field::Str("green".to_string()), Field::Int(2))
+ ]
+ ),
+ (
+ "map_nested".to_string(),
Review Comment:
This is the meat of the PR; would it be possible to only have this column in
the test file? This is a lot to slog through and obscures the point of the test.
##########
parquet/src/record/reader.rs:
##########
@@ -1259,6 +1255,99 @@ mod tests {
assert_eq!(rows, expected_rows);
}
+ #[test]
+ fn test_file_reader_rows_nullable1() {
+ let rows = test_file_reader_rows("databricks.parquet", None).unwrap();
Review Comment:
Likewise, something more descriptive than "databricks".
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]