-
Notifications
You must be signed in to change notification settings - Fork 25.6k
ESQL: Small fixes for COPY_SIGN #132459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESQL: Small fixes for COPY_SIGN #132459
Changes from 7 commits
38ccfbb
82282ba
f8dc1d5
c4015ad
47ca55d
01dbc0e
6d280c0
e525493
8ae1acd
6f3a24c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| pr: 132459 | ||
| summary: Small fixes for COPY_SIGN | ||
| area: ES|QL | ||
| type: bug | ||
| issues: [] |
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.
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.
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.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0; you may not use this file except in compliance with the Elastic License | ||
| * 2.0. | ||
| */ | ||
|
|
||
| package org.elasticsearch.xpack.esql.expression.function.scalar.math; | ||
|
|
||
| import org.elasticsearch.xpack.esql.core.expression.Expression; | ||
| import org.elasticsearch.xpack.esql.core.tree.Source; | ||
| import org.elasticsearch.xpack.esql.core.type.DataType; | ||
| import org.elasticsearch.xpack.esql.expression.function.ErrorsForCasesWithoutExamplesTestCase; | ||
| import org.elasticsearch.xpack.esql.expression.function.TestCaseSupplier; | ||
| import org.hamcrest.Matcher; | ||
|
|
||
| import java.util.List; | ||
| import java.util.Set; | ||
|
|
||
| import static org.hamcrest.Matchers.equalTo; | ||
|
|
||
| public class CopySignErrorTests extends ErrorsForCasesWithoutExamplesTestCase { | ||
| @Override | ||
| protected List<TestCaseSupplier> cases() { | ||
| return paramsToSuppliers(CopySignTests.parameters()); | ||
| } | ||
|
|
||
| @Override | ||
| protected Expression build(Source source, List<Expression> args) { | ||
| return new CopySign(source, args.get(0), args.get(1)); | ||
| } | ||
|
|
||
| @Override | ||
| protected Matcher<String> expectedTypeErrorMatcher(List<Set<DataType>> validPerPosition, List<DataType> signature) { | ||
| return equalTo(typeErrorMessage(true, validPerPosition, signature, (v, i) -> "numeric")); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we just call this
getSuppliersForType()and implement for everything? (Or leave it with an exception for unhandled cases until we need them)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me.