Skip to content

Commit 60d33ec

Browse files
committed
move/hide random
1 parent 50ff91b commit 60d33ec

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/approximate/Approximate.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232
import org.elasticsearch.xpack.esql.expression.function.aggregate.WeightedAvg;
3333
import org.elasticsearch.xpack.esql.expression.function.scalar.EsqlScalarFunction;
3434
import org.elasticsearch.xpack.esql.expression.function.scalar.approximate.ConfidenceInterval;
35+
import org.elasticsearch.xpack.esql.expression.function.scalar.approximate.Random;
3536
import org.elasticsearch.xpack.esql.expression.function.scalar.approximate.Reliable;
3637
import org.elasticsearch.xpack.esql.expression.function.scalar.convert.ToLong;
3738
import org.elasticsearch.xpack.esql.expression.function.scalar.multivalue.MvAppend;
3839
import org.elasticsearch.xpack.esql.expression.function.scalar.multivalue.MvSlice;
39-
import org.elasticsearch.xpack.esql.expression.function.scalar.random.Random;
4040
import org.elasticsearch.xpack.esql.expression.predicate.logical.And;
4141
import org.elasticsearch.xpack.esql.expression.predicate.nulls.IsNotNull;
4242
import org.elasticsearch.xpack.esql.expression.predicate.operator.arithmetic.Div;

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/ExpressionWritables.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import org.elasticsearch.xpack.esql.expression.function.aggregate.AggregateWritables;
1616
import org.elasticsearch.xpack.esql.expression.function.fulltext.FullTextWritables;
1717
import org.elasticsearch.xpack.esql.expression.function.scalar.ScalarFunctionWritables;
18+
import org.elasticsearch.xpack.esql.expression.function.scalar.approximate.Random;
1819
import org.elasticsearch.xpack.esql.expression.function.scalar.convert.FromBase64;
1920
import org.elasticsearch.xpack.esql.expression.function.scalar.convert.ToAggregateMetricDouble;
2021
import org.elasticsearch.xpack.esql.expression.function.scalar.convert.ToBase64;
@@ -62,7 +63,6 @@
6263
import org.elasticsearch.xpack.esql.expression.function.scalar.math.Tan;
6364
import org.elasticsearch.xpack.esql.expression.function.scalar.math.Tanh;
6465
import org.elasticsearch.xpack.esql.expression.function.scalar.multivalue.MvFunctionWritables;
65-
import org.elasticsearch.xpack.esql.expression.function.scalar.random.Random;
6666
import org.elasticsearch.xpack.esql.expression.function.scalar.spatial.SpatialContains;
6767
import org.elasticsearch.xpack.esql.expression.function.scalar.spatial.SpatialDisjoint;
6868
import org.elasticsearch.xpack.esql.expression.function.scalar.spatial.SpatialIntersects;

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/EsqlFunctionRegistry.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@
158158
import org.elasticsearch.xpack.esql.expression.function.scalar.multivalue.MvSum;
159159
import org.elasticsearch.xpack.esql.expression.function.scalar.multivalue.MvZip;
160160
import org.elasticsearch.xpack.esql.expression.function.scalar.nulls.Coalesce;
161-
import org.elasticsearch.xpack.esql.expression.function.scalar.random.Random;
162161
import org.elasticsearch.xpack.esql.expression.function.scalar.score.Decay;
163162
import org.elasticsearch.xpack.esql.expression.function.scalar.spatial.SpatialContains;
164163
import org.elasticsearch.xpack.esql.expression.function.scalar.spatial.SpatialDisjoint;
@@ -535,9 +534,7 @@ private static FunctionDefinition[][] functions() {
535534
def(LastOverTime.class, uni(LastOverTime::new), "last_over_time"),
536535
def(FirstOverTime.class, uni(FirstOverTime::new), "first_over_time"),
537536
// dense vector function
538-
def(TextEmbedding.class, bi(TextEmbedding::new), "text_embedding") },
539-
// random functions
540-
new FunctionDefinition[] { def(Random.class, uni(Random::new), "random") } };
537+
def(TextEmbedding.class, bi(TextEmbedding::new), "text_embedding") } };
541538
}
542539

543540
private static FunctionDefinition[][] snapshotFunctions() {
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,18 @@
55
* 2.0.
66
*/
77

8-
package org.elasticsearch.xpack.esql.expression.function.scalar.random;
8+
package org.elasticsearch.xpack.esql.expression.function.scalar.approximate;
99

1010
import org.elasticsearch.common.Randomness;
1111
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
1212
import org.elasticsearch.common.io.stream.StreamInput;
1313
import org.elasticsearch.compute.ann.Evaluator;
1414
import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator;
15+
import org.elasticsearch.xpack.esql.approximate.Approximate;
1516
import org.elasticsearch.xpack.esql.core.expression.Expression;
1617
import org.elasticsearch.xpack.esql.core.tree.NodeInfo;
1718
import org.elasticsearch.xpack.esql.core.tree.Source;
19+
import org.elasticsearch.xpack.esql.expression.function.EsqlFunctionRegistry;
1820
import org.elasticsearch.xpack.esql.expression.function.FunctionInfo;
1921
import org.elasticsearch.xpack.esql.expression.function.FunctionType;
2022
import org.elasticsearch.xpack.esql.expression.function.Param;
@@ -23,6 +25,10 @@
2325
import java.io.IOException;
2426
import java.util.List;
2527

28+
/**
29+
* This function is used internally by {@link Approximate}, and is not exposed
30+
* to users via the {@link EsqlFunctionRegistry}.
31+
*/
2632
public class Random extends UnaryScalarFunction {
2733
public static final NamedWriteableRegistry.Entry ENTRY = new NamedWriteableRegistry.Entry(Expression.class, "Random", Random::new);
2834

0 commit comments

Comments
 (0)