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.
Further rework on
OpenSearchDataType
:
* Add data types for those classes are not defined in `ExprCoreType`. * Add fixes to make all IT pass. * Complete some TODOs. Address #180 (comment) Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
- Loading branch information
1 parent
e4d89de
commit 16d7ce0
Showing
24 changed files
with
285 additions
and
131 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
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
20 changes: 20 additions & 0 deletions
20
opensearch/src/main/java/org/opensearch/sql/opensearch/data/type/OpenSearchBinaryType.java
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,20 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
|
||
package org.opensearch.sql.opensearch.data.type; | ||
|
||
import static org.opensearch.sql.data.type.ExprCoreType.UNKNOWN; | ||
|
||
import lombok.EqualsAndHashCode; | ||
|
||
@EqualsAndHashCode(callSuper = false) | ||
public class OpenSearchBinaryType extends OpenSearchDataType { | ||
|
||
public OpenSearchBinaryType() { | ||
super(Type.Binary); | ||
exprCoreType = UNKNOWN; | ||
} | ||
} |
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
20 changes: 20 additions & 0 deletions
20
opensearch/src/main/java/org/opensearch/sql/opensearch/data/type/OpenSearchGeoPointType.java
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,20 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
|
||
package org.opensearch.sql.opensearch.data.type; | ||
|
||
import static org.opensearch.sql.data.type.ExprCoreType.UNKNOWN; | ||
|
||
import lombok.EqualsAndHashCode; | ||
|
||
@EqualsAndHashCode(callSuper = false) | ||
public class OpenSearchGeoPointType extends OpenSearchDataType { | ||
|
||
public OpenSearchGeoPointType() { | ||
super(Type.GeoPoint); | ||
exprCoreType = UNKNOWN; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
opensearch/src/main/java/org/opensearch/sql/opensearch/data/type/OpenSearchIpType.java
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,20 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
|
||
package org.opensearch.sql.opensearch.data.type; | ||
|
||
import static org.opensearch.sql.data.type.ExprCoreType.UNKNOWN; | ||
|
||
import lombok.EqualsAndHashCode; | ||
|
||
@EqualsAndHashCode(callSuper = false) | ||
public class OpenSearchIpType extends OpenSearchDataType { | ||
|
||
public OpenSearchIpType() { | ||
super(Type.Ip); | ||
exprCoreType = UNKNOWN; | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
opensearch/src/main/java/org/opensearch/sql/opensearch/data/type/OpenSearchTextType.java
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,32 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.sql.opensearch.data.type; | ||
|
||
import static org.opensearch.sql.data.type.ExprCoreType.STRING; | ||
import static org.opensearch.sql.data.type.ExprCoreType.UNKNOWN; | ||
|
||
import java.util.List; | ||
import org.opensearch.sql.data.type.ExprType; | ||
import lombok.EqualsAndHashCode; | ||
|
||
@EqualsAndHashCode(callSuper = false) | ||
public class OpenSearchTextType extends OpenSearchDataType { | ||
|
||
public OpenSearchTextType() { | ||
super(Type.Text); | ||
exprCoreType = UNKNOWN; | ||
} | ||
|
||
@Override | ||
public List<ExprType> getParent() { | ||
return List.of(STRING); | ||
} | ||
|
||
@Override | ||
public boolean shouldCast(ExprType other) { | ||
return false; | ||
} | ||
} |
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
Oops, something went wrong.