@Test public void testRemoveColumnShiftTimestamp() throws Exception { assertMemoryLeak(() -> { compiler.compile("create table x1 (a int, b double, t timestamp) timestamp(t)", sqlExecutionContext); try (TableReader reader = engine.getReader(sqlExecutionContext.getCairoSecurityContext(), "x1")) { Assert.assertEquals(2, reader.getMetadata().getTimestampIndex()); try (TableWriter writer = engine.getWriter(sqlExecutionContext.getCairoSecurityContext(), "x1")) { Assert.assertEquals(2, writer.getMetadata().getTimestampIndex()); writer.removeColumn("b"); Assert.assertEquals(1, writer.getMetadata().getTimestampIndex()); } Assert.assertTrue(reader.reload()); Assert.assertEquals(1, reader.getMetadata().getTimestampIndex()); } }); }
@NotNull public CompiledQuery compile(@NotNull CharSequence query, @NotNull SqlExecutionContext executionContext) throws SqlException { clear(); lexer.of(query); final CharSequence tok = SqlUtil.fetchNext(lexer); if (tok == null) { throw SqlException.$(0, "empty query"); } final KeywordBasedExecutor executor = keywordBasedExecutors.get(tok); if (executor == null) { return compileUsingModel(executionContext); } return executor.execute(executionContext); }
SqlCompiler implements Closeable { @NotNull public CompiledQuery compile(@NotNull CharSequence query, @NotNull SqlExecutionContext executionContext) throws SqlException { clear(); lexer.of(query); final CharSequence tok = SqlUtil.fetchNext(lexer); if (tok == null) { throw SqlException.$(0, "empty query"); } final KeywordBasedExecutor executor = keywordBasedExecutors.get(tok); if (executor == null) { return compileUsingModel(executionContext); } return executor.execute(executionContext); } }
SqlCompiler implements Closeable { @NotNull public CompiledQuery compile(@NotNull CharSequence query, @NotNull SqlExecutionContext executionContext) throws SqlException { clear(); lexer.of(query); final CharSequence tok = SqlUtil.fetchNext(lexer); if (tok == null) { throw SqlException.$(0, "empty query"); } final KeywordBasedExecutor executor = keywordBasedExecutors.get(tok); if (executor == null) { return compileUsingModel(executionContext); } return executor.execute(executionContext); } SqlCompiler(CairoEngine engine);  SqlCompiler(CairoEngine engine, @Nullable MessageBus messageBus, @Nullable FunctionFactoryCache functionFactoryCache); }
SqlCompiler implements Closeable { @NotNull public CompiledQuery compile(@NotNull CharSequence query, @NotNull SqlExecutionContext executionContext) throws SqlException { clear(); lexer.of(query); final CharSequence tok = SqlUtil.fetchNext(lexer); if (tok == null) { throw SqlException.$(0, "empty query"); } final KeywordBasedExecutor executor = keywordBasedExecutors.get(tok); if (executor == null) { return compileUsingModel(executionContext); } return executor.execute(executionContext); } SqlCompiler(CairoEngine engine);  SqlCompiler(CairoEngine engine, @Nullable MessageBus messageBus, @Nullable FunctionFactoryCache functionFactoryCache); static void configureLexer(GenericLexer lexer); static boolean isAssignableFrom(int to, int from); @Override void close(); @NotNull CompiledQuery compile(@NotNull CharSequence query, @NotNull SqlExecutionContext executionContext); CairoEngine getEngine(); }
SqlCompiler implements Closeable { @NotNull public CompiledQuery compile(@NotNull CharSequence query, @NotNull SqlExecutionContext executionContext) throws SqlException { clear(); lexer.of(query); final CharSequence tok = SqlUtil.fetchNext(lexer); if (tok == null) { throw SqlException.$(0, "empty query"); } final KeywordBasedExecutor executor = keywordBasedExecutors.get(tok); if (executor == null) { return compileUsingModel(executionContext); } return executor.execute(executionContext); } SqlCompiler(CairoEngine engine);  SqlCompiler(CairoEngine engine, @Nullable MessageBus messageBus, @Nullable FunctionFactoryCache functionFactoryCache); static void configureLexer(GenericLexer lexer); static boolean isAssignableFrom(int to, int from); @Override void close(); @NotNull CompiledQuery compile(@NotNull CharSequence query, @NotNull SqlExecutionContext executionContext); CairoEngine getEngine(); static final ObjList<String> sqlControlSymbols; }