|
23 | 23 | import com.datastax.oss.driver.api.core.metadata.schema.ColumnMetadata; |
24 | 24 | import com.datastax.oss.driver.api.core.metadata.schema.KeyspaceMetadata; |
25 | 25 | import com.datastax.oss.driver.api.core.metadata.schema.TableMetadata; |
26 | | -import com.datastax.oss.driver.api.core.type.CqlVectorType; |
| 26 | +import com.datastax.oss.driver.api.core.type.VectorType; |
27 | 27 | import com.datastax.oss.driver.api.core.type.DataType; |
28 | 28 | import com.datastax.oss.driver.api.core.type.ListType; |
29 | 29 | import com.datastax.oss.driver.api.core.type.MapType; |
@@ -80,7 +80,7 @@ public AbstractNativeConverter(KeyspaceMetadata ksm, TableMetadata tm, List<Colu |
80 | 80 | log.info("Add collection schema {}={}", field.name(), collectionSchema); |
81 | 81 | break; |
82 | 82 | case ProtocolConstants.DataType.CUSTOM: |
83 | | - if (cm.getType() instanceof CqlVectorType) { |
| 83 | + if (cm.getType() instanceof VectorType) { |
84 | 84 | Schema vectorSchema = dataTypeSchema(ksm, cm.getType()); |
85 | 85 | subSchemas.put(field.name(), vectorSchema); |
86 | 86 | log.info("Add vector schema {}={}", field.name(), vectorSchema); |
@@ -139,7 +139,7 @@ boolean isSupportedCqlType(DataType dataType) { |
139 | 139 | case ProtocolConstants.DataType.MAP: |
140 | 140 | return true; |
141 | 141 | case ProtocolConstants.DataType.CUSTOM: |
142 | | - return dataType instanceof CqlVectorType; |
| 142 | + return dataType instanceof VectorType; |
143 | 143 | case ProtocolConstants.DataType.TUPLE: |
144 | 144 | return true; |
145 | 145 | } |
@@ -210,14 +210,14 @@ Schema dataTypeSchema(KeyspaceMetadata ksm, DataType dataType) { |
210 | 210 | case ProtocolConstants.DataType.MAP: |
211 | 211 | MapType mapType = (MapType) dataType; |
212 | 212 | return org.apache.avro.Schema.createMap(dataTypeSchema(ksm, mapType.getValueType())); |
213 | | - case ProtocolConstants.DataType.CUSTOM: |
214 | | - if (dataType instanceof CqlVectorType) { |
215 | | - CqlVectorType vectorType = (CqlVectorType) dataType; |
216 | | - return org.apache.avro.Schema.createArray(dataTypeSchema(ksm, vectorType.getSubtype())); |
217 | | - } |
218 | 213 | case ProtocolConstants.DataType.TUPLE: |
219 | 214 | TupleType tupleType = (TupleType) dataType; |
220 | 215 | return buildTupleSchema(ksm, dataType.asCql(false, true), tupleType, true); |
| 216 | + case ProtocolConstants.DataType.CUSTOM: |
| 217 | + if (dataType instanceof VectorType) { |
| 218 | + VectorType vectorType = (VectorType) dataType; |
| 219 | + return org.apache.avro.Schema.createArray(dataTypeSchema(ksm, vectorType.getElementType())); |
| 220 | + } |
221 | 221 | default: |
222 | 222 | throw new UnsupportedOperationException("Ignoring unsupported type=" + dataType.asCql(false, true)); |
223 | 223 | } |
|
0 commit comments