@@ -163,7 +163,7 @@ public ElasticsearchTableHandle getTableHandle(ConnectorSession session, SchemaT
163163 query = Optional .of (parts [1 ]);
164164 }
165165
166- if (client .indexExists (table ) && !client .getIndexMetadata (table ).getSchema ().getFields ().isEmpty ()) {
166+ if (client .indexExists (table ) && !client .getIndexMetadata (table ).schema ().fields ().isEmpty ()) {
167167 return new ElasticsearchTableHandle (SCAN , schemaName , table , query );
168168 }
169169 }
@@ -205,12 +205,12 @@ private InternalTableMetadata makeInternalTableMetadata(String schema, String ta
205205
206206 private List <IndexMetadata .Field > getColumnFields (IndexMetadata metadata )
207207 {
208- Map <String , Long > counts = metadata .getSchema ()
209- .getFields ().stream ()
210- .collect (Collectors .groupingBy (f -> f .getName ().toLowerCase (ENGLISH ), Collectors .counting ()));
208+ Map <String , Long > counts = metadata .schema ()
209+ .fields ().stream ()
210+ .collect (Collectors .groupingBy (f -> f .name ().toLowerCase (ENGLISH ), Collectors .counting ()));
211211
212- return metadata .getSchema ().getFields ().stream ()
213- .filter (field -> toTrino (field ) != null && counts .get (field .getName ().toLowerCase (ENGLISH )) <= 1 )
212+ return metadata .schema ().fields ().stream ()
213+ .filter (field -> toTrino (field ) != null && counts .get (field .name ().toLowerCase (ENGLISH )) <= 1 )
214214 .collect (toImmutableList ());
215215 }
216216
@@ -224,7 +224,7 @@ private List<ColumnMetadata> makeColumnMetadata(List<IndexMetadata.Field> fields
224224
225225 for (IndexMetadata .Field field : fields ) {
226226 result .add (ColumnMetadata .builder ()
227- .setName (field .getName ())
227+ .setName (field .name ())
228228 .setType (toTrino (field ).type ())
229229 .build ());
230230 }
@@ -241,11 +241,11 @@ private Map<String, ColumnHandle> makeColumnHandles(List<IndexMetadata.Field> fi
241241
242242 for (IndexMetadata .Field field : fields ) {
243243 TypeAndDecoder converted = toTrino (field );
244- result .put (field .getName (), new ElasticsearchColumnHandle (
245- field .getName (),
244+ result .put (field .name (), new ElasticsearchColumnHandle (
245+ field .name (),
246246 converted .type (),
247247 converted .decoderDescriptor (),
248- supportsPredicates (field .getType ())));
248+ supportsPredicates (field .type ())));
249249 }
250250
251251 return result .buildOrThrow ();
@@ -258,7 +258,7 @@ private static boolean supportsPredicates(IndexMetadata.Type type)
258258 }
259259
260260 if (type instanceof PrimitiveType ) {
261- switch (((PrimitiveType ) type ).getName ().toLowerCase (ENGLISH )) {
261+ switch (((PrimitiveType ) type ).name ().toLowerCase (ENGLISH )) {
262262 case "boolean" :
263263 case "byte" :
264264 case "short" :
@@ -281,7 +281,7 @@ private TypeAndDecoder toTrino(IndexMetadata.Field field)
281281
282282 private TypeAndDecoder toTrino (String prefix , IndexMetadata .Field field )
283283 {
284- String path = appendPath (prefix , field .getName ());
284+ String path = appendPath (prefix , field .name ());
285285
286286 checkArgument (!field .asRawJson () || !field .isArray (), format ("A column, (%s) cannot be declared as a Trino array and also be rendered as json." , path ));
287287
@@ -294,9 +294,9 @@ private TypeAndDecoder toTrino(String prefix, IndexMetadata.Field field)
294294 return new TypeAndDecoder (new ArrayType (element .type ()), new ArrayDecoder .Descriptor (element .decoderDescriptor ()));
295295 }
296296
297- IndexMetadata .Type type = field .getType ();
297+ IndexMetadata .Type type = field .type ();
298298 if (type instanceof PrimitiveType primitiveType ) {
299- switch (primitiveType .getName ()) {
299+ switch (primitiveType .name ()) {
300300 case "float" :
301301 return new TypeAndDecoder (REAL , new RealDecoder .Descriptor (path ));
302302 case "double" :
@@ -324,16 +324,16 @@ else if (type instanceof ScaledFloatType) {
324324 return new TypeAndDecoder (DOUBLE , new DoubleDecoder .Descriptor (path ));
325325 }
326326 else if (type instanceof DateTimeType dateTimeType ) {
327- if (dateTimeType .getFormats ().isEmpty ()) {
327+ if (dateTimeType .formats ().isEmpty ()) {
328328 return new TypeAndDecoder (TIMESTAMP_MILLIS , new TimestampDecoder .Descriptor (path ));
329329 }
330330 // otherwise, skip -- we don't support custom formats, yet
331331 }
332332 else if (type instanceof ObjectType objectType ) {
333333 ImmutableList .Builder <RowType .Field > rowFieldsBuilder = ImmutableList .builder ();
334334 ImmutableList .Builder <RowDecoder .NameAndDescriptor > decoderFields = ImmutableList .builder ();
335- for (IndexMetadata .Field rowField : objectType .getFields ()) {
336- String name = rowField .getName ();
335+ for (IndexMetadata .Field rowField : objectType .fields ()) {
336+ String name = rowField .name ();
337337 TypeAndDecoder child = toTrino (path , rowField );
338338
339339 if (child != null ) {
@@ -365,7 +365,7 @@ private static String appendPath(String base, String element)
365365 public static IndexMetadata .Field elementField (IndexMetadata .Field field )
366366 {
367367 checkArgument (field .isArray (), "Cannot get element field from a non-array field" );
368- return new IndexMetadata .Field (field .asRawJson (), false , field .getName (), field .getType ());
368+ return new IndexMetadata .Field (field .asRawJson (), false , field .name (), field .type ());
369369 }
370370
371371 @ Override
@@ -547,9 +547,9 @@ public Optional<ConstraintApplicationResult<ConnectorTableHandle>> applyFilter(C
547547
548548 if (!newRegexes .containsKey (columnName ) && pattern instanceof Slice ) {
549549 IndexMetadata metadata = client .getIndexMetadata (handle .index ());
550- if (metadata .getSchema ()
551- .getFields ().stream ()
552- .anyMatch (field -> columnName .equals (field .getName ()) && field .getType () instanceof PrimitiveType && "keyword" .equals (((PrimitiveType ) field .getType ()).getName ()))) {
550+ if (metadata .schema ()
551+ .fields ().stream ()
552+ .anyMatch (field -> columnName .equals (field .name ()) && field .type () instanceof PrimitiveType && "keyword" .equals (((PrimitiveType ) field .type ()).name ()))) {
553553 newRegexes .put (columnName , likeToRegexp ((Slice ) pattern , escape ));
554554 continue ;
555555 }
0 commit comments