-
Notifications
You must be signed in to change notification settings - Fork 0
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
[Spotless] Applying Google Code Format for core/src/main files #2 #313
[Spotless] Applying Google Code Format for core/src/main files #2 #313
Conversation
Codecov Report
@@ Coverage Diff @@
## integ/sl_GoogleJavaFormat2 #313 +/- ##
================================================================
- Coverage 97.39% 97.34% -0.06%
+ Complexity 4603 4405 -198
================================================================
Files 401 371 -30
Lines 11397 11129 -268
Branches 835 774 -61
================================================================
- Hits 11100 10833 -267
+ Misses 290 289 -1
Partials 7 7
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 29 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Checkstyle fails for some of the changes. |
b698850
to
b8aea35
Compare
* Use this unresolved plan visitor to check if a plan can be serialized by PaginatedPlanCache. If | ||
* | ||
* <pre>plan.accept(new CanPaginateVisitor(...))</pre> | ||
* | ||
* returns <em>true</em>, then PaginatedPlanCache.convertToCursor will succeed. Otherwise, it will | ||
* fail. The purpose of this visitor is to activate legacy engine fallback mechanism. Currently, V2 | ||
* engine does not support queries with: - aggregation (GROUP BY clause or aggregation functions | ||
* like min/max) - in memory aggregation (window function) - LIMIT/OFFSET clause(s) - without FROM | ||
* clause - JOIN - a subquery V2 also requires that the table being queried should be an OpenSearch | ||
* index. See PaginatedPlanCache.canConvertToCursor for usage. |
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.
It looks like you need to add more pre tags to this take make all of the lines not lose formatting
* @param visitor visitor | ||
* @param context context | ||
* @param <T> result type | ||
* @param <C> context type | ||
* @return result accumulated by visitor when visiting |
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.
would adding pre tags here help fix the even spacing from being lost?
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.
It would, but I don't think it's worth it as @oaram are important parts of Javadocs so I think we shouldn't mess with it.
* @param node function node | ||
* @param context context | ||
* @return result |
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.
another spacing issue
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.
I think it's an improvement removing the extra spaces
* Call visitFunction() by default rather than visitChildren(). This makes CASE/WHEN able to be | ||
* handled: 1) by visitFunction() if not overwritten: ex. FilterQueryBuilder 2) by | ||
* visitCase/When() otherwise if any special logic: ex. ExprReferenceOptimizer |
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.
Needs pre tags
* @param <T> type of return value to accumulate when visiting. | ||
* @param <C> type of context. |
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.
technically the spacing on this one is still fine because both lines have the same length but still should have pre
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.
I don't think it makes a difference?
* Named expression that represents expression with name. Please see more details in associated | ||
* unresolved expression operator {@link org.opensearch.sql.ast.expression.Alias}. |
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.
Needs pre
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.
resolved.
* Resolve the ExprValue from {@link ExprTupleValue} using paths. Considering the following sample | ||
* data. { "name": "bob smith" "project.year": 1990, "project": { "year": "2020" } "address": { | ||
* "state": "WA", "city": "seattle", "project.year": 1990 } "address.local": { "state": "WA", } } | ||
* The paths could be 1. top level, e.g. "name", which will be resolved as "bob smith" 2. multiple | ||
* paths, e.g. "name.address.state", which will be resolved as "WA" 3. special case, the "." is | ||
* the path separator, but it is possible that the path include ".", for handling this use case, | ||
* we define the resolve rule as bellow, e.g. "project.year" is resolved as 1990 instead of 2020. | ||
* Note. This logic only applied top level none object field. e.g. "address.local.state" been | ||
* resolved to Missing. but "address.project.year" could been resolved as 1990. |
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.
needs pre
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.
Resolved.
* 3) Sliding window frame that maintains a sliding window of fixed size | ||
* Note that which type of window frame is used is determined by both window function itself | ||
* and frame definition in a window definition. | ||
* Window frame that represents a subset of a window which is all data accessible to the window |
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.
Needs tags as well
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.
Resolved.
@@ -82,11 +75,10 @@ public ExprValue current() { | |||
/** | |||
* Preload all peer rows if last peer rows done. Note that when no more data in peeking iterator, | |||
* there must be rows in frame (hasNext()=true), so no need to check it.hasNext() in this method. | |||
* Load until: |
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.
Needs tags as well
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.
Fixed
* 1. Ranking window functions: ignore frame definition and always operates on | ||
* previous and current row. | ||
* 2. Aggregate window functions: frame partition into peers and sliding window is not supported. | ||
* Create specific window frame based on window definition and what's current window function. For |
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.
Needs tags as well
* The definition of text functions. | ||
* 1) have the clear interface for function define. | ||
* 2) the implementation should rely on ExprValue. | ||
* The definition of text functions. 1) have the clear interface for function define. 2) the |
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.
Needs tags as well
* float/double integer float/double (field type) | ||
* float/double double float/double (field type) | ||
* other any field type | ||
* Return type follows the following table. FIELD VALUE RETURN_TYPE int/long integer int/long |
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.
Needs tags as well
* NULL NULL | ||
* MISSING MISSING | ||
*/ | ||
/** The not logic. A NOT A TRUE FALSE FALSE TRUE NULL NULL MISSING MISSING */ |
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.
LOL a not a true false false true null null missing missing.
Needs tags as well
* FALSE MISSING MISSING | ||
* NULL NULL NULL | ||
* NULL MISSING NULL | ||
* The xor logic. A B A AND B TRUE TRUE FALSE TRUE FALSE TRUE TRUE NULL TRUE TRUE MISSING TRUE |
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.
Needs tags as well
* NULL NULL NULL | ||
* NULL MISSING NULL | ||
* MISSING MISSING MISSING | ||
* The or logic. A B A AND B TRUE TRUE TRUE TRUE FALSE TRUE TRUE NULL TRUE TRUE MISSING TRUE FALSE |
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.
Needs tags as well
* FALSE MISSING FALSE | ||
* NULL NULL NULL | ||
* NULL MISSING MISSING | ||
* The and logic. A B A AND B TRUE TRUE TRUE TRUE FALSE FALSE TRUE NULL NULL TRUE MISSING MISSING |
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.
Needs tags as well
* or, Accepts two Boolean values and produces a Boolean. | ||
* xor, Accepts two Boolean values and produces a Boolean. | ||
* equalTo, Compare the left expression and right expression and produces a Boolean. | ||
* The definition of binary predicate function and, Accepts two Boolean values and produces a |
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.
Needs tags as well
* The supported signature of floor function is | ||
* (STRING, INTEGER, INTEGER) -> STRING | ||
* (INTEGER, INTEGER, INTEGER) -> STRING | ||
* Definition of conv(x, a, b) function. Convert number x from base a to base b The supported |
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.
Needs tags as well
* The definition of date and time functions. | ||
* 1) have the clear interface for function define. | ||
* 2) the implementation should rely on ExprValue. | ||
* The definition of date and time functions. 1) have the clear interface for function define. 2) |
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.
Needs tags as well
* (TIME, INTERVAL) -> TIME // when interval has no date part | ||
* (STRING, INTERVAL) -> STRING // when argument has date or datetime string, | ||
* // result has date or datetime depending on interval type | ||
* A common signature for `date_add` and `date_sub`. Specify a start date and add/subtract a |
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.
Needs tags as well
* Adds/subtracts an integer number of days to/from the first argument. | ||
* (DATE, LONG) -> DATE | ||
* (TIME/DATETIME/TIMESTAMP, LONG) -> DATETIME | ||
* A common signature for `adddate` and `subdate`. Adds/subtracts an integer number of days |
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.
Needs tags as well
* (STRING, STRING/TIME) -> STRING // second arg - string with time only | ||
* (x, STRING) -> NULL // second arg - string with timestamp | ||
* (x, STRING/DATE) -> x // second arg - string with date only | ||
* Adds expr2 to expr1 and returns the result. (TIME, TIME/DATE/DATETIME/TIMESTAMP) -> TIME |
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.
Needs tags as well
* (x, x) -> NULL // when args have different types | ||
* (STRING, STRING) -> TIME // argument strings contain same types only | ||
* (STRING, STRING) -> NULL // argument strings are different types | ||
* Returns different between two times as a time. (TIME, TIME) -> TIME MySQL has these signatures |
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.
Needs tags as well
* (DATETIME, STRING) -> STRING | ||
* (TIME, STRING) -> STRING | ||
* (TIMESTAMP, STRING) -> STRING | ||
* Formats date according to format specifier. First argument is time, second is format. Detailed |
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.
Needs tags as well
* - negative year is not accepted | ||
* - @dayOfYear should be greater than 1 | ||
* - if @dayOfYear is greater than 365/366, calculation goes to the next year(s) | ||
* Furthermore: - zero year interpreted as 2000 - negative year is not accepted - @dayOfYear |
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.
Needs tags as well
45fe539
to
66c98ae
Compare
/** | ||
* Call visitFunction() by default rather than visitChildren(). | ||
* This makes CASE/WHEN able to be handled: | ||
* * <ol> |
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.
you have added a new * here
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.
Added!
* (x: BYTE/SHORT/INTEGER/LONG/FLOAT/DOUBLE, y: BYTE/SHORT/INTEGER/LONG/FLOAT/DOUBLE) | ||
* -> wider type between types of x and y | ||
* Definition of divide(x, y) function. Returns the number x divided by number y The supported | ||
* signature of divide function is (x: BYTE/SHORT/INTEGER/LONG/FLOAT/DOUBLE, y: |
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.
Can you add
tags here?
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.
Added!
* (x: BYTE/SHORT/INTEGER/LONG/FLOAT/DOUBLE, y: BYTE/SHORT/INTEGER/LONG/FLOAT/DOUBLE) | ||
* -> wider type between types of x and y | ||
* Definition of modulus(x, y) function. Returns the number x modulo by number y The supported | ||
* signature of modulo function is (x: BYTE/SHORT/INTEGER/LONG/FLOAT/DOUBLE, y: |
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.
can you add
tags here?
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.
Added!
* (x: BYTE/SHORT/INTEGER/LONG/FLOAT/DOUBLE, y: BYTE/SHORT/INTEGER/LONG/FLOAT/DOUBLE) | ||
* -> wider type between types of x and y | ||
* Definition of multiply(x, y) function. Returns the number x multiplied by number y The | ||
* supported signature of multiply function is (x: BYTE/SHORT/INTEGER/LONG/FLOAT/DOUBLE, y: |
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.
can you add
tags here?
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.
Added!
* The supported signature of subtract function is | ||
* (x: BYTE/SHORT/INTEGER/LONG/FLOAT/DOUBLE, y: BYTE/SHORT/INTEGER/LONG/FLOAT/DOUBLE) | ||
* -> wider type between types of x and y | ||
* Definition of subtract(x, y) function. Returns the number x minus number y The supported |
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.
can you add
tags here?
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.
Added!
* The supported signature of mod function is | ||
* (x: INTEGER/LONG/FLOAT/DOUBLE, y: INTEGER/LONG/FLOAT/DOUBLE) | ||
* -> wider type between types of x and y | ||
* Definition of mod(x, y) function. Calculate the remainder of x divided by y The supported |
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.
can you add
tags here?
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.
Added!
core/src/main/java/org/opensearch/sql/expression/operator/arthmetic/MathematicalFunction.java
Outdated
Show resolved
Hide resolved
* Definition of atan(x) and atan(y, x) function. atan(x) calculates the arc tangent of x, that | ||
* is, the value whose tangent is x. atan(y, x) calculates the arc tangent of y / x, except that | ||
* the signs of both arguments are used to determine the quadrant of the result. The supported | ||
* signature of atan function is (x: INTEGER/LONG/FLOAT/DOUBLE, y: INTEGER/LONG/FLOAT/DOUBLE) -> |
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.
can you add
tags here?
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.
Added!
8394d4e
to
70688c7
Compare
Signed-off-by: Mitchell Gale <[email protected]>
Signed-off-by: Mitchell Gale <[email protected]>
…erator.java ExpressionNodeVisitor.java StreamingQueryPlan.java Signed-off-by: Mitchell Gale <[email protected]>
…on.java QualifiedName.java Signed-off-by: Mitchell Gale <[email protected]>
Signed-off-by: Mitchell Gale <[email protected]>
7b281a6
to
326671f
Compare
Signed-off-by: Mitchell Gale <[email protected]>
Signed-off-by: Mitchell Gale <[email protected]>
Signed-off-by: Mitchell Gale <[email protected]>
Signed-off-by: Mitchell Gale <[email protected]>
Signed-off-by: Mitchell Gale <[email protected]>
Signed-off-by: Guian Gumpac <[email protected]>
Signed-off-by: Mitchell Gale <[email protected]>
Signed-off-by: Mitchell Gale <[email protected]>
Signed-off-by: Mitchell Gale <[email protected]>
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.
You already included this file in part 1 in #312
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.
This is also present in #312 with other changes
*/ | ||
public class NoCursorException extends RuntimeException { | ||
} | ||
public class NoCursorException extends RuntimeException {} |
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.
{}
will conflict with checkstyle
* Execute physical plan and call back response listener. Todo. deprecated this interface after | ||
* finalize {@link ExecutionContext}. |
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.
* Execute physical plan and call back response listener. Todo. deprecated this interface after | |
* finalize {@link ExecutionContext}. | |
* Execute physical plan and call back response listener.<br /> | |
* TODO: deprecate this interface after finalize {@link ExecutionContext}. |
* Execute the {@link UnresolvedPlan}, using {@link ResponseListener} to get response. Todo. | ||
* deprecated this interface after finalize {@link PlanContext}. |
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.
* Execute the {@link UnresolvedPlan}, using {@link ResponseListener} to get response. Todo. | |
* deprecated this interface after finalize {@link PlanContext}. | |
* Execute the {@link UnresolvedPlan}, using {@link ResponseListener} to get response.<br /> | |
* TODO: deprecate this interface after finalize {@link PlanContext}. |
@@ -87,6 +132,7 @@ public static void register(BuiltinFunctionRepository repository) { | |||
.build(); | |||
|
|||
/** | |||
* <pre> |
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.
Make a table too?
@@ -115,6 +162,7 @@ public static void register(BuiltinFunctionRepository repository) { | |||
.build(); | |||
|
|||
/** | |||
* <pre> |
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.
Make a table too?
} | ||
|
||
/** | ||
* <pre> |
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.
Make a table too?
return rounding.round(field.valueOf(valueEnv)); | ||
} | ||
|
||
/** | ||
* <pre> |
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.
Make a table?
* REPLACE(str, from_str, to_str) returns the string str with all occurrences of | ||
* the string from_str replaced by the string to_str. | ||
* REPLACE() performs a case-sensitive match when searching for from_str. | ||
* Supports following signature: |
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.
Maybe: add <br />
to put signature on the next line (for all functions)
Description
This PR applies Spotless on Java code for:
core/src/main/java/org/opensearch/sql/exception
core/src/main/java/org/opensearch/sql/executor
core/src/main/java/org/opensearch/sql/expression
core/src/main/java/org/opensearch/sql/monitor
Issues Resolved
[List any issues this PR will resolve]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.