mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-26 23:07:45 +00:00
SQL: NOCOMMIT cleanup
Removes a few NOCOMMITs that are tracked other places and updates a few with plans on how to work on them. Original commit: elastic/x-pack-elasticsearch@8d1cfdf4ee
This commit is contained in:
parent
1ede8cadf7
commit
6ea902f913
@ -31,7 +31,6 @@ import java.util.function.BiFunction;
|
|||||||
* statements like {@code SHOW TABLES} and {@code DESCRIBE TABLE}.
|
* statements like {@code SHOW TABLES} and {@code DESCRIBE TABLE}.
|
||||||
*/
|
*/
|
||||||
public class SecurityCatalogFilter implements FilteredCatalog.Filter {
|
public class SecurityCatalogFilter implements FilteredCatalog.Filter {
|
||||||
// NOCOMMIT need to figure out sql on aliases that expand to many indices
|
|
||||||
private static final IndicesOptions OPTIONS = IndicesOptions.strictSingleIndexNoExpandForbidClosed();
|
private static final IndicesOptions OPTIONS = IndicesOptions.strictSingleIndexNoExpandForbidClosed();
|
||||||
|
|
||||||
private final ThreadContext threadContext;
|
private final ThreadContext threadContext;
|
||||||
|
@ -36,13 +36,11 @@ public class CliHttpClient implements AutoCloseable {
|
|||||||
|
|
||||||
public QueryInitResponse queryInit(String query, int fetchSize) {
|
public QueryInitResponse queryInit(String query, int fetchSize) {
|
||||||
// TODO allow customizing the time zone
|
// TODO allow customizing the time zone
|
||||||
// NOCOMMIT figure out Timeouts....
|
|
||||||
QueryInitRequest request = new QueryInitRequest(query, fetchSize, TimeZone.getTimeZone("UTC"), new TimeoutInfo(0, 0, 0));
|
QueryInitRequest request = new QueryInitRequest(query, fetchSize, TimeZone.getTimeZone("UTC"), new TimeoutInfo(0, 0, 0));
|
||||||
return (QueryInitResponse) sendRequest(request);
|
return (QueryInitResponse) sendRequest(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
public QueryPageResponse nextPage(byte[] cursor) {
|
public QueryPageResponse nextPage(byte[] cursor) {
|
||||||
// NOCOMMIT figure out Timeouts....
|
|
||||||
QueryPageRequest request = new QueryPageRequest(cursor, new TimeoutInfo(0, 0, 0));
|
QueryPageRequest request = new QueryPageRequest(cursor, new TimeoutInfo(0, 0, 0));
|
||||||
return (QueryPageResponse) sendRequest(request);
|
return (QueryPageResponse) sendRequest(request);
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ abstract class ResponseToString {
|
|||||||
return sb;
|
return sb;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressForbidden(reason="ignore for now") // NOCOMMIT figure this out
|
@SuppressForbidden(reason="ignore for now") // NOCOMMIT replace this with saving the file and printing a message
|
||||||
private static void displayGraphviz(String str) {
|
private static void displayGraphviz(String str) {
|
||||||
try {
|
try {
|
||||||
// save the content to a temp file
|
// save the content to a temp file
|
||||||
|
@ -16,12 +16,11 @@ import java.util.Objects;
|
|||||||
import static org.elasticsearch.xpack.sql.jdbc.net.protocol.ProtoUtils.classOf;
|
import static org.elasticsearch.xpack.sql.jdbc.net.protocol.ProtoUtils.classOf;
|
||||||
import static org.elasticsearch.xpack.sql.jdbc.net.protocol.ProtoUtils.readValue;
|
import static org.elasticsearch.xpack.sql.jdbc.net.protocol.ProtoUtils.readValue;
|
||||||
import static org.elasticsearch.xpack.sql.jdbc.net.protocol.ProtoUtils.writeValue;
|
import static org.elasticsearch.xpack.sql.jdbc.net.protocol.ProtoUtils.writeValue;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores a page of data in a columnar format.
|
* Stores a page of data in a columnar format.
|
||||||
*/
|
*/
|
||||||
public class Page implements Payload {
|
public class Page implements Payload {
|
||||||
private final List<ColumnInfo> columnInfo;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The actual data, one array per column.
|
* The actual data, one array per column.
|
||||||
*/
|
*/
|
||||||
|
@ -20,7 +20,7 @@ public class ProtoUtils {
|
|||||||
// NOCOMMIT <T> feels slippery here
|
// NOCOMMIT <T> feels slippery here
|
||||||
Object result;
|
Object result;
|
||||||
byte hasNext = in.readByte();
|
byte hasNext = in.readByte();
|
||||||
if (hasNext == 0) { // NOCOMMIT feels like a bitmask at the start of the row would be better.
|
if (hasNext == 0) { // TODO feels like a bitmask at the start of the row would be better.
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
// NOCOMMIT we ought to make sure we use all of these
|
// NOCOMMIT we ought to make sure we use all of these
|
||||||
|
@ -77,11 +77,11 @@ public class QueryInitResponse extends AbstractQueryResponse {
|
|||||||
}
|
}
|
||||||
QueryInitResponse other = (QueryInitResponse) obj;
|
QueryInitResponse other = (QueryInitResponse) obj;
|
||||||
return columns.equals(other.columns);
|
return columns.equals(other.columns);
|
||||||
// NOCOMMIT data
|
// NOCOMMIT equals should take into account data
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(super.hashCode(), columns); // NOCOMMIT data
|
return Objects.hash(super.hashCode(), columns); // NOCOMMIT equals should take into account data
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -27,6 +27,7 @@ public class SqlResponse extends ActionResponse implements ToXContentObject {
|
|||||||
private long size;
|
private long size;
|
||||||
private int columnCount;
|
private int columnCount;
|
||||||
private List<ColumnInfo> columns;
|
private List<ColumnInfo> columns;
|
||||||
|
// NOCOMMIT investigate reusing Page here - it probably is much more efficient
|
||||||
private List<List<Object>> rows;
|
private List<List<Object>> rows;
|
||||||
|
|
||||||
public SqlResponse() {
|
public SqlResponse() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user