forked from apache/drill
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DRILL-2385: Count on complex objects failed with missing function imp…
…lementation - added MapHolder, ListHolder; - added testCountComplexObjects() unit test.
- Loading branch information
1 parent
3209886
commit f86c4fa
Showing
11 changed files
with
201 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
exec/java-exec/src/test/resources/complex/json/complex.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{"sia":[1, 11, 101, 1001], | ||
"sfa":[0.0, 1.01, 10.222, 10.0006789], | ||
"soa":[{"in":1},{"in":1,"fl":1.12345}, {"in":1, "fl":10.12345, "nul":null}, {"in":1, "fl":10.6789, "nul":null, "bool":true, "str":"here is a string at row 1"}], | ||
"oooi":{"oa":{"oab":{"oabc":1}}}, | ||
"odd": [ | ||
[[1],[],[3]], | ||
[], | ||
[[5]] | ||
] | ||
} | ||
{"sia":[2, 12, 102, 1002], | ||
"sfa":[0.0, 2.01, 20.222, 20.0006789], | ||
"soa":[{"in":2},{"in":2,"fl":2.12345}, {"in":2, "fl":20.12345, "nul":"not null"}, {"in":2, "fl":20.6789, "nul":null, "bool":false, "str":"here is a string at row 2"}], | ||
"oooi":{"oa":{"oab":{"oabc":2}}}, | ||
"odd": [ | ||
[[1],[],[3]], | ||
[], | ||
[[5]] | ||
] | ||
} | ||
{"sia":[3, 13, 103, 1003], | ||
"sfa":[0.0, 3.01, 30.222, 30.0006789], | ||
"soa":[{"in":3},{"in":3,"fl":3.12345}, {"in":3, "fl":30.12345, "nul":"not null"}, {"in":3, "fl":30.6789, "nul":"not null", "bool":true, "str":"here is a string at row 3"}], | ||
"oooi":{"oa":{"oab":{"oabc":3}}}, | ||
"odd": [ | ||
[[1],[],[3]], | ||
[], | ||
[[5]] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ | |
[], | ||
[[5]] | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ | |
[], | ||
[{"val": [7]}] | ||
] | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
exec/vector/src/main/java/org/apache/drill/exec/expr/holders/ListHolder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.apache.drill.exec.expr.holders; | ||
|
||
import org.apache.drill.common.types.TypeProtos; | ||
import org.apache.drill.common.types.Types; | ||
import org.apache.drill.exec.vector.complex.reader.FieldReader; | ||
|
||
public class ListHolder implements ValueHolder { | ||
public static final TypeProtos.MajorType TYPE = Types.optional(TypeProtos.MinorType.LIST); | ||
public FieldReader reader; | ||
public int isSet; | ||
|
||
public TypeProtos.MajorType getType() { | ||
return TYPE; | ||
} | ||
|
||
public boolean isSet() { | ||
return isSet == 1; | ||
} | ||
|
||
} |
32 changes: 32 additions & 0 deletions
32
exec/vector/src/main/java/org/apache/drill/exec/expr/holders/MapHolder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.apache.drill.exec.expr.holders; | ||
|
||
import org.apache.drill.common.types.TypeProtos; | ||
import org.apache.drill.common.types.Types; | ||
import org.apache.drill.exec.vector.complex.reader.FieldReader; | ||
|
||
public class MapHolder implements ValueHolder { | ||
public static final TypeProtos.MajorType TYPE = Types.required(TypeProtos.MinorType.MAP); | ||
public FieldReader reader; | ||
|
||
public TypeProtos.MajorType getType() { | ||
return TYPE; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters