Skip to content

Commit 3d7af58

Browse files
committed
implemented DSE Types in CodecFactory
1 parent 6460a8b commit 3d7af58

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

pom.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,11 @@
143143
<artifactId>log4j-to-slf4j</artifactId>
144144
<version>${log4j.version}</version>
145145
</dependency>
146+
<dependency>
147+
<groupId>com.esri.geometry</groupId>
148+
<artifactId>esri-geometry-api</artifactId>
149+
<version>2.2.0</version>
150+
</dependency>
146151

147152
<!-- Test Dependencies -->
148153
<dependency>
@@ -326,7 +331,7 @@
326331
<counter>LINE</counter>
327332
<value>MISSEDCOUNT</value>
328333
<!-- <maximum>1544</maximum>-->
329-
<maximum>3076</maximum>
334+
<maximum>3080</maximum>
330335
</limit>
331336
</limits>
332337
</rule>

src/main/java/com/datastax/cdm/cql/codec/CodecFactory.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
package com.datastax.cdm.cql.codec;
22

33
import com.datastax.cdm.properties.PropertyHelper;
4+
import com.datastax.dse.driver.internal.core.type.codec.geometry.LineStringCodec;
5+
import com.datastax.dse.driver.internal.core.type.codec.geometry.PointCodec;
6+
import com.datastax.dse.driver.internal.core.type.codec.geometry.PolygonCodec;
7+
import com.datastax.dse.driver.internal.core.type.codec.time.DateRangeCodec;
48
import com.datastax.oss.driver.api.core.type.codec.TypeCodec;
59

610
import java.util.Arrays;
@@ -15,6 +19,11 @@ public static List<TypeCodec<?>> getCodecPair(PropertyHelper propertyHelper, Cod
1519
case DECIMAL_STRING: return Arrays.asList(new DECIMAL_StringCodec(propertyHelper), new TEXT_BigDecimalCodec(propertyHelper));
1620
case TIMESTAMP_STRING_MILLIS: return Arrays.asList(new TIMESTAMP_StringMillisCodec(propertyHelper), new TEXTMillis_InstantCodec(propertyHelper));
1721
case TIMESTAMP_STRING_FORMAT: return Arrays.asList(new TIMESTAMP_StringFormatCodec(propertyHelper), new TEXTFormat_InstantCodec(propertyHelper));
22+
case POLYGON_TYPE: return Arrays.asList(new PolygonCodec());
23+
case POINT_TYPE: return Arrays.asList(new PointCodec());
24+
case DATE_RANGE: return Arrays.asList(new DateRangeCodec());
25+
case LINE_STRING: return Arrays.asList(new LineStringCodec());
26+
1827
default:
1928
throw new IllegalArgumentException("Unknown codec: " + codec);
2029
}

src/main/java/com/datastax/cdm/cql/codec/Codecset.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,9 @@ public enum Codecset {
66
BIGINT_STRING,
77
DECIMAL_STRING,
88
TIMESTAMP_STRING_MILLIS,
9-
TIMESTAMP_STRING_FORMAT
9+
TIMESTAMP_STRING_FORMAT,
10+
POINT_TYPE,
11+
POLYGON_TYPE,
12+
DATE_RANGE,
13+
LINE_STRING
1014
}

0 commit comments

Comments
 (0)