Skip to content

Commit e584368

Browse files
Merge branch 'opensearch-project:main' into main
2 parents 2f3aeb6 + f483247 commit e584368

File tree

46 files changed

+1055
-61
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1055
-61
lines changed

async-query/src/test/resources/flint-index-mappings/flint_mys3_default_http_logs_cv1_index.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"number_of_replicas": 0,
3131
"max_result_window": 100,
3232
"version": {
33-
"created": "6050399"
33+
"created": "137217827"
3434
}
3535
}
3636
},

async-query/src/test/resources/flint-index-mappings/flint_mys3_default_http_logs_skipping_index.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"number_of_replicas": 0,
4040
"max_result_window": 100,
4141
"version": {
42-
"created": "6050399"
42+
"created": "137217827"
4343
}
4444
}
4545
},

async-query/src/test/resources/flint-index-mappings/npe_mapping.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"number_of_replicas": 0,
2525
"max_result_window": 100,
2626
"version": {
27-
"created": "6050399"
27+
"created": "137217827"
2828
}
2929
}
3030
},

common/src/main/java/org/opensearch/sql/common/grok/GrokCompiler.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ public Grok compile(final String pattern, ZoneId defaultTimeZone, boolean namedO
185185
(group.get("subname") != null ? group.get("subname") : group.get("name")));
186186
namedRegex =
187187
StringUtils.replace(namedRegex, "%{" + group.get("name") + "}", replacement, 1);
188-
// System.out.println(_expanded_pattern);
189188
index++;
190189
}
191190
}

common/src/test/java/org/opensearch/sql/common/grok/ApacheDataTypeTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ public void test002_httpd_access_semi() throws GrokException {
4949
+ " HTTP/%{NUMBER:httpversion;float})?|%{DATA:rawrequest})\" %{NUMBER:response;int}"
5050
+ " (?:%{NUMBER:bytes;long}|-)");
5151

52-
System.out.println(line);
5352
Match gm = grok.match(line);
5453
Map<String, Object> map = gm.capture();
5554

common/src/test/java/org/opensearch/sql/common/grok/ApacheTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ public void test001_httpd_access() throws GrokException, IOException {
3838

3939
BufferedReader br = new BufferedReader(new FileReader(LOG_FILE));
4040
String line;
41-
System.out.println("Starting test with httpd log");
4241
while ((line = br.readLine()) != null) {
4342
Match gm = grok.match(line);
4443
final Map<String, Object> capture = gm.capture();
@@ -50,7 +49,6 @@ public void test001_httpd_access() throws GrokException, IOException {
5049
@Test
5150
public void test002_nasa_httpd_access() throws GrokException, IOException {
5251
Grok grok = compiler.compile("%{COMMONAPACHELOG}");
53-
System.out.println("Starting test with nasa log -- may take a while");
5452
BufferedReader br;
5553
String line;
5654
File dir = new File(LOG_DIR_NASA);

common/src/test/java/org/opensearch/sql/common/grok/GrokTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,6 @@ public void test013_IpSet() throws Throwable {
317317
try (FileReader fr = new FileReader(Resources.getResource(ResourceManager.IP).getFile());
318318
BufferedReader br = new BufferedReader(fr)) {
319319
String line;
320-
System.out.println("Starting test with ip");
321320
while ((line = br.readLine()) != null) {
322321
Match gm = grok.match(line);
323322
final Map<String, Object> map = gm.capture();

common/src/test/java/org/opensearch/sql/common/grok/MessagesTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ public void test001_linux_messages() throws GrokException, IOException {
2929
new BufferedReader(
3030
new FileReader(Resources.getResource(ResourceManager.MESSAGES).getFile()));
3131
String line;
32-
System.out.println("Starting test with linux messages log -- may take a while");
3332
while ((line = br.readLine()) != null) {
3433
Match gm = grok.match(line);
3534
Map<String, Object> map = gm.capture();

core/src/main/java/org/opensearch/sql/calcite/utils/PPLOperandTypes.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,12 @@ private PPLOperandTypes() {}
112112
SqlTypeFamily.INTEGER,
113113
SqlTypeFamily.INTEGER));
114114

115+
public static final UDFOperandMetadata NUMERIC_STRING_OR_STRING_STRING =
116+
UDFOperandMetadata.wrap(
117+
(CompositeOperandTypeChecker)
118+
(OperandTypes.family(SqlTypeFamily.NUMERIC, SqlTypeFamily.STRING))
119+
.or(OperandTypes.family(SqlTypeFamily.STRING, SqlTypeFamily.STRING)));
120+
115121
public static final UDFOperandMetadata NUMERIC_NUMERIC_OPTIONAL_NUMERIC =
116122
UDFOperandMetadata.wrap(
117123
(CompositeOperandTypeChecker)

core/src/main/java/org/opensearch/sql/expression/function/PPLBuiltinOperators.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
import org.opensearch.sql.expression.function.udf.RexExtractMultiFunction;
6868
import org.opensearch.sql.expression.function.udf.RexOffsetFunction;
6969
import org.opensearch.sql.expression.function.udf.SpanFunction;
70+
import org.opensearch.sql.expression.function.udf.ToStringFunction;
7071
import org.opensearch.sql.expression.function.udf.condition.EarliestFunction;
7172
import org.opensearch.sql.expression.function.udf.condition.EnhancedCoalesceFunction;
7273
import org.opensearch.sql.expression.function.udf.condition.LatestFunction;
@@ -411,6 +412,7 @@ public class PPLBuiltinOperators extends ReflectiveSqlOperatorTable {
411412
RELEVANCE_QUERY_FUNCTION_INSTANCE.toUDF("multi_match", false);
412413
public static final SqlOperator NUMBER_TO_STRING =
413414
new NumberToStringFunction().toUDF("NUMBER_TO_STRING");
415+
public static final SqlOperator TOSTRING = new ToStringFunction().toUDF("TOSTRING");
414416
public static final SqlOperator WIDTH_BUCKET =
415417
new org.opensearch.sql.expression.function.udf.binning.WidthBucketFunction()
416418
.toUDF("WIDTH_BUCKET");

0 commit comments

Comments
 (0)