[fix](ParquetReader) definition level of repeated parent is wrong (#17337)

Fix three bugs:
1.  `repeated_parent_def_level ` should be the definition of its repeated parent.
2. Failed to parse schema like `decimal(p, s)`
3. Fill wrong offsets for array type
This commit is contained in:
Ashin Gau
2023-03-06 18:15:57 +08:00
committed by GitHub
parent 843b4b5746
commit dca16796ad
3 changed files with 21 additions and 16 deletions

View File

@ -676,13 +676,18 @@ public class HiveMetaStoreClientHelper {
*/
private static int findNextNestedField(String commaSplitFields) {
int numLess = 0;
int numBracket = 0;
for (int i = 0; i < commaSplitFields.length(); i++) {
char c = commaSplitFields.charAt(i);
if (c == '<') {
numLess++;
} else if (c == '>') {
numLess--;
} else if (c == ',' && numLess == 0) {
} else if (c == '(') {
numBracket++;
} else if (c == ')') {
numBracket--;
} else if (c == ',' && numLess == 0 && numBracket == 0) {
return i;
}
}