Skip to content

Commit

Permalink
Add support for index aliases for SYS COLUMNS command (#53672)
Browse files Browse the repository at this point in the history
(cherry picked from commit f65e4d6)
  • Loading branch information
astefan committed Mar 17, 2020
1 parent a2e92d0 commit 70d2c7c
Show file tree
Hide file tree
Showing 7 changed files with 658 additions and 53 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

package org.elasticsearch.xpack.sql.qa.single_node;

import org.elasticsearch.xpack.sql.qa.jdbc.SysColumnsTestCase;

public class SysColumnsIT extends SysColumnsTestCase {

}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package org.elasticsearch.xpack.sql.type;

import org.elasticsearch.xpack.sql.SqlIllegalArgumentException;
import org.elasticsearch.xpack.sql.util.StringUtils;

import java.util.Objects;

Expand All @@ -25,6 +26,11 @@ public InvalidMappedField(String name, String errorMessage) {
this.errorMessage = errorMessage;
}

public InvalidMappedField(String name) {
super(name, DataType.UNSUPPORTED, emptyMap(), false);
this.errorMessage = StringUtils.EMPTY;
}

public String errorMessage() {
return errorMessage;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,11 @@ public static <T> List<T> combine(Collection<? extends T> left, T... entries) {
}
return list;
}

public static int mapSize(int size) {
if (size < 2) {
return size + 1;
}
return (int) (size / 0.75f + 1f);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,8 @@ public static IndexResolution merge(EsIndex... indices) {
}

public static List<EsIndex> separate(EsIndex... indices) {
return IndexResolver.separateMappings("*", null, Stream.of(indices).map(EsIndex::name).toArray(String[]::new),
fromMappings(indices));
return IndexResolver.separateMappings(null, Stream.of(indices).map(EsIndex::name).toArray(String[]::new),
fromMappings(indices), null);
}

public static Map<String, Map<String, FieldCapabilities>> fromMappings(EsIndex... indices) {
Expand Down

0 comments on commit 70d2c7c

Please sign in to comment.