Skip to content

Backport work around #3744

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

Closed
wants to merge 135 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
135 commits
Select commit Hold shift + click to select a range
3c6ba76
Add CIDR function to PPL (#3036) (#3110)
currantw Dec 3, 2024
6b0a0f3
Add FILLNULL command in PPL (#3032) (#3075)
normanj-bitquill Dec 5, 2024
77fe0c2
Add trendline PPL command (#3071)
jduo Dec 12, 2024
1b4cce5
* Add `ExprIpValue` and `IP` data type
currantw Dec 19, 2024
34fb767
Framework of Calcite Engine: Parser, Catalog Binding and Plan Convert…
LantaoJin Jan 17, 2025
4cc5947
[POC] Make PPL execute successfully on Calcite engine (#3258)
qianheng-aws Feb 7, 2025
da999cc
Make basic aggregation working (part 1) (#3318)
LantaoJin Feb 13, 2025
908fd1f
[Calcite Engine] Push down project and filter operator into index sca…
qianheng-aws Feb 21, 2025
3c8997b
[Calcite] Build integration test framework (#3342)
LantaoJin Feb 26, 2025
82b074e
Followup: Register OpenSearchTypeSystem to OpenSearchTypeFactory (#3349)
LantaoJin Feb 26, 2025
c7dd3f8
Make basic aggregation working (part 2) : adding tests (#3355)
LantaoJin Feb 27, 2025
ab287e8
Fix execution errors caused by plan gap (#3350)
qianheng-aws Feb 27, 2025
459f00e
Implement ppl join command with Calcite (#3364)
LantaoJin Feb 28, 2025
ff52d8b
Enable push down optimization by default (#3366)
qianheng-aws Feb 28, 2025
24c7814
Fix CalcitePPLJoinIT (#3369)
qianheng-aws Mar 3, 2025
5f22078
Implement ppl `IN` subquery command with Calcite (#3371)
LantaoJin Mar 4, 2025
4960a88
fix java 21 syntax
xinyual Jun 1, 2025
4e45c83
fix IT for syntax 21
xinyual Jun 2, 2025
455038d
[BugFix] support push down text field correctly. (#3376)
qianheng-aws Mar 4, 2025
21dca31
Add udf interface (#3374)
xinyual Mar 4, 2025
9fb1b64
[BugFix] Fix the join condition resolving bug introduced by IN subque…
LantaoJin Mar 5, 2025
c4af931
Implement ppl relation subquery command with Calcite (#3378)
LantaoJin Mar 6, 2025
824b4d8
Implement ppl exists subquery command with Calcite (#3388)
LantaoJin Mar 7, 2025
96cce47
Implement ppl scalar subquery command with Calcite (#3392)
LantaoJin Mar 7, 2025
f9abd75
Calcite enable pushdown aggregation (#3389)
qianheng-aws Mar 7, 2025
450ab10
Add string builtin functions (#3393)
xinyual Mar 10, 2025
56596c0
Keep aggregation in Calcite consistent with current PPL behavior (#3405)
LantaoJin Mar 11, 2025
5fae05b
Support multiple table and index pattern (#3409)
qianheng-aws Mar 11, 2025
bcb89b1
Separate with/without pushdown ITs (#3413)
LantaoJin Mar 12, 2025
5d4b15e
Add condition UDFs (#3412)
xinyual Mar 13, 2025
57f550c
Fix IT and CI, revert alias change (#3423)
penghuo Mar 14, 2025
e762e31
Revert result ordering of `stats-by` (#3427)
LantaoJin Mar 14, 2025
30651a7
Implement lookup command (#3419)
qianheng-aws Mar 14, 2025
bd274f3
Support ppl BETWEEN operator within Calcite (#3433)
LantaoJin Mar 17, 2025
5438555
Correct the precedence for logical operators (#3435)
LantaoJin Mar 17, 2025
75e1d18
Implement ppl `dedup` command with Calcite (#3416)
LantaoJin Mar 17, 2025
bf7ee7b
Use entire shadow jar to fix IT (#3447)
xinyual Mar 25, 2025
f52ae27
use entireShadowJar
xinyual Mar 25, 2025
20be9d8
[Calcite Engine] Support In expression (#3429)
qianheng-aws Mar 18, 2025
4df743e
Support ppl CAST function with Calcite (#3439)
LantaoJin Mar 19, 2025
cfb4a60
Support group by span over time based column with Span UDF (#3421)
songkant-aws Mar 19, 2025
b257be8
Add math udf (#3390)
xinyual Mar 20, 2025
fc8d652
Fix flaky tests (#3456)
yuancu Mar 20, 2025
a46db88
fix syntax in java 21
xinyual Jun 3, 2025
ff0776d
fix syntax for java 21
xinyual Jun 3, 2025
63e0c8f
json-valid PPL function (#3230)
kenrickyap Jan 16, 2025
b701a5a
json-valid PPL function (#3230)
kenrickyap Jan 16, 2025
c1ed682
remove geo ip
acarbonetto Feb 11, 2025
d4ea612
Enable Calcite by default and refactor all related ITs (#3468)
LantaoJin Mar 24, 2025
7c1f449
remove geo ip
xinyual Jun 3, 2025
dc0449c
Unified OpenSearch PPL Data Type (#3345)
penghuo Mar 25, 2025
b45512f
Add missing text function (#3471)
xinyual Mar 26, 2025
5027a8c
[Calcite engine] Support nested field (#3476)
qianheng-aws Mar 26, 2025
6053bc0
[Followup] fix text function IT for locate and strcmp (#3482)
xinyual Mar 27, 2025
67f4477
Support `TYPEOF` function with Calcite (#3446)
LantaoJin Mar 27, 2025
f8c9fb4
Support `parse` command with Calcite (#3474)
LantaoJin Mar 28, 2025
fd2b3a8
[Calcite Engine]Support UDT for date, time, timestamp (#3483)
qianheng-aws Mar 28, 2025
ab46f8d
Support for OpenSearch alias type (#3246)
qianheng-aws Jan 23, 2025
3c24ea0
[Calcite Engine] Support UDT for IP (#3504)
qianheng-aws Apr 2, 2025
0681f04
Execute Calcite PPL query in thread pool (#3508)
LantaoJin Apr 2, 2025
a01dd57
Add datetime functions (#3473)
xinyual Apr 3, 2025
e1b04e2
use correct timezone name (#3517)
xinyual Apr 6, 2025
262be2c
Improved patterns command with new algorithm (#3263) (#3335)
songkant-aws Feb 19, 2025
eeba423
Fix antlr4 parser issues (#3492)
LantaoJin Apr 7, 2025
f49004f
Fix return types of MOD and DIVIDE UDFs (#3513)
yuancu Apr 7, 2025
7c88ca1
Support line comment and block comment in PPL (#2806)
LantaoJin Apr 8, 2025
0a7728b
fix varchar bug (#3518)
xinyual Apr 8, 2025
86af993
[Calcite Engine] Function framework refactoring (#3522)
qianheng-aws Apr 9, 2025
89bfc56
New output for explain endpoint with Calcite engine (#3521)
LantaoJin Apr 9, 2025
e3d641f
unified settings
penghuo Apr 9, 2025
f941234
Fix GET_FORMAT UDF (#3543)
yuancu Apr 14, 2025
721b897
[Calcite Engine] Support alias type field (#3538)
qianheng-aws Apr 14, 2025
b513c5d
[Calcite Engine] Only enable fallback for tests that need to fall bac…
qianheng-aws Apr 15, 2025
7231730
remove geo ip it
xinyual Jun 3, 2025
b10d483
Support UDT for BINARY (#3549)
qianheng-aws Apr 16, 2025
4020058
fix timestamp bug (#3542)
xinyual Apr 17, 2025
3916204
[Calcite Engine]Support metadata field (#3445)
qianheng-aws Apr 22, 2025
1d09bb9
Support `explain` PPL command (#3560)
LantaoJin Apr 24, 2025
1b2c786
New added commands should throw exception when calcite disabled (#3571)
LantaoJin Apr 24, 2025
cd8912c
Support `CASE` function with Calcite (#3558)
LantaoJin Apr 24, 2025
06a3bd3
Support parsing documents with flattened value (#3577)
qianheng-aws Apr 28, 2025
976065a
Revert stream pattern method in V2 and implement SIMPLE_PATTERN in Ca…
songkant-aws Apr 30, 2025
b743796
[DOC] Remove the duplicated timestamp row in data type mapping table …
LantaoJin May 6, 2025
b1ee3df
[DOC] Documentation for PPL new engine (V3) and limitations of 3.0.0 …
LantaoJin Apr 1, 2025
64f3390
Support `eventstats` command with Calcite (#3585)
LantaoJin May 7, 2025
4461511
Implement cryptographic hash UDFs (#3574)
yuancu May 12, 2025
3dde94b
Add a new row count estimation mechanism for CalciteIndexScan (#3605)
qianheng-aws May 14, 2025
ea752a7
Migrate existing UDFs to PPLFuncImpTable (#3576)
yuancu May 14, 2025
e926582
Add UT for PredicateAnalyzer and AggregateAnalyzer (#3612)
qianheng-aws May 14, 2025
7cc887f
Add a trimmed project before aggregate to avoid NPE in Calcite (#3621)
LantaoJin May 15, 2025
c905c57
Add a TPC-H PPL query suite (#3622)
LantaoJin May 19, 2025
64e9cfd
Support functions `isempty`, `isblank` and `ispresent` with Calcite (…
LantaoJin May 20, 2025
3c2b0c6
Support `describe` command with Calcite (#3624)
LantaoJin May 21, 2025
ac394da
Support `fillnull` command with Calcite (#3634)
LantaoJin May 21, 2025
2a51060
Support function `coalesce` with Calcite (#3628)
yuancu May 21, 2025
eac0be3
Implement `cidrmatch` udf with Calcite (#3603)
yuancu May 22, 2025
e78352d
Fix pushing down filter with nested filed of the text type (#3645)
qianheng-aws May 22, 2025
92ccaff
Fix alias type points to nested field (#3674)
qianheng-aws May 27, 2025
ed104a2
Support `top`, `rare` commands with Calcite (#3647)
LantaoJin May 28, 2025
2ae84cb
Support match_only_text field type (#3663)
penghuo May 28, 2025
f41b531
Update PPL Limitation Docs (#3656)
penghuo May 28, 2025
8c03519
Make query.size_limit only affect the final results (#3623)
qianheng-aws May 28, 2025
c359a94
fix missing conflict
xinyual Jun 3, 2025
0defdcd
Switch percentile implementation to MergingDigest to align with OpenS…
LantaoJin May 30, 2025
f708f7b
Support Limit pushdown (#3615)
yuancu May 30, 2025
cc275df
fix java 21 syntax and apply spotless on develop code
xinyual Jun 3, 2025
a9363ed
fix syntax for IT
xinyual Jun 3, 2025
ebceb03
restore useless change
xinyual Jun 4, 2025
55c7ad7
fix IT
xinyual Jun 4, 2025
eaeadff
remove useless change
xinyual Jun 4, 2025
f5b7a7f
fix IT
xinyual Jun 4, 2025
48a8f16
Revert "Switch percentile implementation to MergingDigest to align wi…
xinyual Jun 4, 2025
9cc8bdf
fix IT
xinyual Jun 4, 2025
40de8d5
fix part of IT
xinyual Jun 4, 2025
0be4e15
Support GEO_POINT type (#3511)
qianheng-aws Apr 2, 2025
46bef64
fix IT
xinyual Jun 4, 2025
ba0b695
fix IT by add timestamp value
xinyual Jun 4, 2025
34ed823
revert change
xinyual Jun 4, 2025
dc32437
ignore Prometheus with calcite as previous
xinyual Jun 5, 2025
83f51a2
fix Patterns IT
xinyual Jun 5, 2025
358d430
fix UT
xinyual Jun 5, 2025
6c7a2b6
fix IT by workaround
xinyual Jun 6, 2025
d7904aa
fix IT and doctest
xinyual Jun 6, 2025
dda896d
fix UT and doctest
xinyual Jun 8, 2025
eb3e918
fix UT and revert change
xinyual Jun 9, 2025
00f46b5
remove useless UT
xinyual Jun 9, 2025
1d15132
Support Grok command in Calcite engine (#3678)
songkant-aws Jun 4, 2025
0979762
Support `appendcol` command with Calcite (#3729)
LantaoJin Jun 4, 2025
169bd70
Support decimal literal with Calcite (#3673)
LantaoJin Jun 4, 2025
60b5e29
Support ResourceMonitor with Calcite (#3738)
LantaoJin Jun 5, 2025
51c4d78
Implement Parameter Validation for PPL functions on Calcite (#3626)
yuancu Jun 6, 2025
001d277
fix IT
xinyual Jun 9, 2025
c5875f9
fix bwc
xinyual Jun 9, 2025
ae31cde
fix 21 syntax
xinyual Jun 9, 2025
3bd8a21
avoid resolve safe
xinyual Jun 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion DEVELOPER_GUIDE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ Sample test class:
Doctest
>>>>>>>

Python doctest library makes our document executable which keeps it up-to-date to source code. The doc generator aforementioned served as scaffolding and generated many docs in short time. Now the examples inside is changed to doctest gradually. For more details please read `Doctest <./dev/Doctest.md>`_.
Python doctest library makes our document executable which keeps it up-to-date to source code. The doc generator aforementioned served as scaffolding and generated many docs in short time. Now the examples inside is changed to doctest gradually. For more details please read `testing-doctest <./docs/dev/testing-doctest.md>`_.


Backports
Expand Down
9 changes: 9 additions & 0 deletions benchmarks/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,13 @@ dependencies {
annotationProcessor group: 'org.openjdk.jmh', name: 'jmh-generator-annprocess', version: '1.36'
}

spotless {
java {
target fileTree('.') {
include '**/*.java'
exclude '**/jmh_generated/**'
}
}
}

compileJava.options.compilerArgs.addAll(["-processor", "org.openjdk.jmh.generators.BenchmarkProcessor"])
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

package org.opensearch.sql.expression.operator.predicate;

import static org.opensearch.sql.data.model.ExprTupleValue.fromExprValueMap;
import static org.opensearch.sql.data.type.ExprCoreType.STRING;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Iterators;
import com.google.common.collect.PeekingIterator;
import java.util.concurrent.TimeUnit;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Fork;
import org.openjdk.jmh.annotations.Measurement;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OutputTimeUnit;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.State;
import org.openjdk.jmh.annotations.Warmup;
import org.opensearch.sql.common.patterns.BrainLogParser;
import org.opensearch.sql.data.model.ExprStringValue;
import org.opensearch.sql.data.model.ExprValue;
import org.opensearch.sql.expression.DSL;
import org.opensearch.sql.expression.Expression;
import org.opensearch.sql.expression.NamedArgumentExpression;
import org.opensearch.sql.expression.ReferenceExpression;
import org.opensearch.sql.expression.window.WindowDefinition;
import org.opensearch.sql.expression.window.frame.BufferPatternRowsWindowFrame;
import org.opensearch.sql.expression.window.frame.CurrentRowWindowFrame;
import org.opensearch.sql.expression.window.frame.WindowFrame;

@Warmup(iterations = 1)
@Measurement(iterations = 3)
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Thread)
@Fork(value = 1)
public class PatternsWindowFunctionBenchmark {

private static final String TEST_MESSAGE_1 =
"12.132.31.17 - - [2018-07-22T05:36:25.812Z] \\\"GET /opensearch HTTP/1.1\\\" 200 9797"
+ " \\\"-\\\" \\\"Mozilla/5.0 (X11; Linux x86_64; rv:6.0a1) Gecko/20110421"
+ " Firefox/6.0a1\\\"";
private static final String TEST_MESSAGE_2 =
"129.138.185.193 - - [2018-07-22T05:39:39.668Z] \\\"GET /opensearch HTTP/1.1\\\" 404 9920"
+ " \\\"-\\\" \\\"Mozilla/5.0 (X11; Linux x86_64; rv:6.0a1) Gecko/20110421"
+ " Firefox/6.0a1\\\"";
private static final String TEST_MESSAGE_3 =
"240.58.187.246 - - [2018-07-22T06:02:46.006Z] \\\"GET /opensearch HTTP/1.1\\\" 500 6936"
+ " \\\"-\\\" \\\"Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.24 (KHTML, like Gecko)"
+ " Chrome/11.0.696.50 Safari/534.24\\\"";

private PeekingIterator<ExprValue> tuples;
private final BufferPatternRowsWindowFrame bufferWindowFrame =
new BufferPatternRowsWindowFrame(
new WindowDefinition(ImmutableList.of(), ImmutableList.of()),
new BrainLogParser(),
new NamedArgumentExpression("message", new ReferenceExpression("message", STRING)));

@Benchmark
public void testSimplePattern() {
CurrentRowWindowFrame windowFrame =
new CurrentRowWindowFrame(new WindowDefinition(ImmutableList.of(), ImmutableList.of()));

run(windowFrame, DSL.simple_pattern(DSL.ref("message", STRING)));
}

@Benchmark
public void testBrain() {
BufferPatternRowsWindowFrame windowFrame =
new BufferPatternRowsWindowFrame(
new WindowDefinition(ImmutableList.of(), ImmutableList.of()),
new BrainLogParser(),
new NamedArgumentExpression("message", new ReferenceExpression("message", STRING)));

run(windowFrame, DSL.brain(DSL.ref("message", STRING)));
}

private void run(WindowFrame windowFrame, Expression windowFunction) {
tuples =
Iterators.peekingIterator(
Iterators.forArray(
tuple(TEST_MESSAGE_1), tuple(TEST_MESSAGE_2), tuple(TEST_MESSAGE_3)));
while (tuples.hasNext() || windowFrame.hasNext()) {
windowFrame.load(tuples);
windowFunction.valueOf(windowFrame);
}
}

private ExprValue tuple(String message) {
return fromExprValueMap(ImmutableMap.of("message", new ExprStringValue(message)));
}
}
28 changes: 27 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,16 @@ buildscript {
return "https://github.com/prometheus/prometheus/releases/download/v${prometheus_binary_version}/prometheus-${prometheus_binary_version}."+ getOSFamilyType() + "-" + getArchType() + ".tar.gz"
}
aws_java_sdk_version = "1.12.651"
guava_version = "32.1.3-jre"
guava_version = "33.3.0-jre"
resilience4j_version = "1.5.0"
hamcrest_version = "2.1"
mockito_version = "5.7.0"
commons_io_version = "2.14.0"
commons_text_version = "1.10.0"
commons_lang3_version = "3.12.0"
// enforce 1.13, https://www.whitesourcesoftware.com/vulnerability-database/WS-2019-0379
commons_codec_version = "1.13"
commons_logging_version = "1.2"
}

repositories {
Expand Down Expand Up @@ -122,6 +131,23 @@ allprojects {
resolutionStrategy.force "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.0"
resolutionStrategy.force "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.0"
resolutionStrategy.force "net.bytebuddy:byte-buddy:1.14.9"
resolutionStrategy.force "org.apache.httpcomponents.client5:httpclient5:5.4.4"
resolutionStrategy.force "org.apache.httpcomponents.core5:httpcore5:5.3.4"
resolutionStrategy.force "org.apache.httpcomponents.core5:httpcore5-h2:5.3.4"
resolutionStrategy.force "com.fasterxml.jackson.core:jackson-annotations:2.18.2"
resolutionStrategy.force "com.fasterxml.jackson.core:jackson-core:2.18.2"
resolutionStrategy.force "com.fasterxml.jackson.core:jackson-databind:2.18.2"
resolutionStrategy.force "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.18.2"
resolutionStrategy.force "com.fasterxml.jackson.dataformat:jackson-dataformat-smile:2.18.2"
resolutionStrategy.force "com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.18.2"
resolutionStrategy.force 'com.google.protobuf:protobuf-java:3.25.5'
resolutionStrategy.force 'org.locationtech.jts:jts-core:1.19.0'
resolutionStrategy.force 'com.google.errorprone:error_prone_annotations:2.28.0'
resolutionStrategy.force 'org.checkerframework:checker-qual:3.43.0'
resolutionStrategy.force 'org.apache.commons:commons-lang3:3.13.0'
resolutionStrategy.force 'org.apache.commons:commons-text:1.11.0'
resolutionStrategy.force 'commons-io:commons-io:2.15.0'
resolutionStrategy.force 'org.yaml:snakeyaml:2.2'
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
Expand Down Expand Up @@ -174,9 +175,10 @@ public Grok compile(final String pattern, ZoneId defaultTimeZone, boolean namedO
throw new IllegalArgumentException(
format("No definition for key '%s' found, aborting", group.get("pattern")));
}
String replacement = String.format("(?<name%d>%s)", index, definitionOfPattern);
String replacement =
String.format(Locale.ROOT, "(?<name%d>%s)", index, definitionOfPattern);
if (namedOnly && group.get("subname") == null) {
replacement = String.format("(?:%s)", definitionOfPattern);
replacement = String.format(Locale.ROOT, "(?:%s)", definitionOfPattern);
}
namedRegexCollection.put(
"name" + index,
Expand Down
Loading
Loading