Skip to content
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
import static org.elasticsearch.compute.gen.Types.DOUBLE_VECTOR;
import static org.elasticsearch.compute.gen.Types.DOUBLE_VECTOR_BUILDER;
import static org.elasticsearch.compute.gen.Types.DOUBLE_VECTOR_FIXED_BUILDER;
import static org.elasticsearch.compute.gen.Types.FLOAT_BLOCK_BUILDER;
import static org.elasticsearch.compute.gen.Types.FLOAT_VECTOR_BUILDER;
import static org.elasticsearch.compute.gen.Types.FLOAT_VECTOR_FIXED_BUILDER;
import static org.elasticsearch.compute.gen.Types.INT_BLOCK;
import static org.elasticsearch.compute.gen.Types.INT_BLOCK_BUILDER;
import static org.elasticsearch.compute.gen.Types.INT_VECTOR;
Expand Down Expand Up @@ -216,6 +219,9 @@ static String appendMethod(TypeName t) {
if (t.equals(TypeName.DOUBLE) || t.equals(DOUBLE_BLOCK) || t.equals(DOUBLE_VECTOR)) {
return "appendDouble";
}
if (t.equals(TypeName.FLOAT) || t.equals(FLOAT_BLOCK_BUILDER)) {
return "appendFloat";
}
throw new IllegalArgumentException("unknown append method for [" + t + "]");
}

Expand Down Expand Up @@ -266,6 +272,15 @@ static String buildFromFactory(TypeName t) {
if (t.equals(DOUBLE_VECTOR_FIXED_BUILDER)) {
return "newDoubleVectorFixedBuilder";
}
if (t.equals(FLOAT_BLOCK_BUILDER)) {
return "newFloatBlockBuilder";
}
if (t.equals(FLOAT_VECTOR_BUILDER)) {
return "newFloatVectorBuilder";
}
if (t.equals(FLOAT_VECTOR_FIXED_BUILDER)) {
return "newFloatVectorFixedBuilder";
}
throw new IllegalArgumentException("unknown build method for [" + t + "]");
}

Expand All @@ -289,6 +304,9 @@ static String getMethod(TypeName elementType) {
if (elementType.equals(TypeName.DOUBLE)) {
return "getDouble";
}
if (elementType.equals(TypeName.FLOAT)) {
return "getFloat";
}
throw new IllegalArgumentException("unknown get method for [" + elementType + "]");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,9 @@ static TypeName elementType(TypeName t) {
if (t.equals(DOUBLE_BLOCK) || t.equals(DOUBLE_VECTOR) || t.equals(DOUBLE_BLOCK_BUILDER)) {
return TypeName.DOUBLE;
}
if (t.equals(FLOAT_BLOCK) || t.equals(FLOAT_VECTOR) || t.equals(FLOAT_BLOCK_BUILDER)) {
return TypeName.FLOAT;
}
throw new IllegalArgumentException("unknown element type for [" + t + "]");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1842,3 +1842,29 @@ emp_no:integer | l1:double | l2:double
10002 | -7.23 | null
10003 | 4.0 | null
;

copySignWithMixedNumericValues
required_capability: copy_sign

ROW cs1=COPY_SIGN(10.0, -5.0), cs2=COPY_SIGN(10, 1), cs3=COPY_SIGN(1, -5.0);

cs1:double | cs2:integer | cs3:integer
-10.0 | 10 | -1
;

copySignWithMixedNumericValuesWithMV
required_capability: mixed_numeric_types_in_case_greatest_least
required_capability: copy_sign

FROM employees
| EVAL cs1 = COPY_SIGN(salary, LEAST(salary_change))
| KEEP emp_no, salary, salary_change, cs1
| SORT emp_no
| LIMIT 3
;

emp_no:integer | salary:integer | salary_change:double | cs1:integer
10001 | 57305 | 1.19 | 57305
10002 | 56371 | [-7.23, 11.17] | -56371
10003 | 61805 | [12.82, 14.68] | 61805
;

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading