forked from apache/spark
-
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.
[DX] spark sql support GeometryUDT type to create/select based on sed…
…ona.
- Loading branch information
Showing
8 changed files
with
52 additions
and
1 deletion.
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
26 changes: 26 additions & 0 deletions
26
sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/UDTUtil.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,26 @@ | ||
package org.apache.hive.service.cli; | ||
|
||
import org.apache.hadoop.hive.serde2.thrift.Type; | ||
import org.apache.spark.sql.sedona_sql.UDT.GeometryUDT$; | ||
import org.apache.spark.sql.sedona_sql.UDT.RasterUDT$; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
final class UDTUtil { | ||
private final static Map<String, String> udtTypes; | ||
|
||
static { | ||
udtTypes = new HashMap<String, String>(); | ||
udtTypes.put(GeometryUDT$.MODULE$.simpleString(), Type.STRING_TYPE.getName()); | ||
udtTypes.put(RasterUDT$.MODULE$.simpleString(), Type.STRING_TYPE.getName()); | ||
} | ||
|
||
static boolean existsType(String simpleType) { | ||
return udtTypes.containsKey(simpleType); | ||
} | ||
|
||
static String getType(String simpleType) { | ||
return udtTypes.get(simpleType); | ||
} | ||
} |
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