[FIX](complex-type) fix Is null predict for map/struct (#17497)

Fix is null predicate is not supported in select statement for map and struct column
This commit is contained in:
amory
2023-03-08 17:03:06 +08:00
committed by GitHub
parent feacb15e71
commit b1ca87eb9b
3 changed files with 80 additions and 5 deletions

View File

@ -32,6 +32,7 @@ import com.google.gson.annotations.SerializedName;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Objects;
/**
* Describes a STRUCT type. STRUCT types have a list of named struct fields.
@ -152,12 +153,14 @@ public class StructType extends Type {
return true;
}
if (t.isStructType()) {
if (!t.isStructType()) {
return false;
}
if (fields.size() != ((StructType) t).getFields().size()) {
return false;
StructType other = (StructType) t;
if (fields.size() != other.getFields().size()) {
// Temp to make NullPredict from fe send to be
return other.getFields().size() == 1 && Objects.equals(other.getFields().get(0).name, "null_pred");
}
for (int i = 0; i < fields.size(); i++) {