forked from opensearch-project/sql
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Update Lexer and Parser. - Add `DSL::cidr` and BuiltinFunctionName.CIDR`. - Add `BinaryPredicateOperator::cidr`. - Add `IPUtils` with stub implementation of `isAddressInRange`. Signed-off-by: currantw <[email protected]>
- Loading branch information
Showing
7 changed files
with
42 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package org.opensearch.sql.utils; | ||
|
||
import org.opensearch.sql.data.model.ExprBooleanValue; | ||
import org.opensearch.sql.data.model.ExprValue; | ||
|
||
public class IPUtils { | ||
|
||
/** | ||
* Returns whether the given IP address is within the specified IP address range. | ||
* Supports both IPv4 and IPv6 addresses. | ||
* | ||
* @param address IP address (e.g. "198.51.100.14" or "2001:0db8::ff00:42:8329"). | ||
* @param range IP address range in CIDR notation (e.g. "198.51.100.0/24" or "2001:0db8:/32") | ||
* @return true value if IP address is in range; else false value. | ||
*/ | ||
public static ExprBooleanValue isAddressInRange(ExprValue address, ExprValue range) { | ||
|
||
// TODO - implementation | ||
return ExprBooleanValue.of(true); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters