#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace DB; int main(int argc, char ** argv) try { Poco::AutoPtr channel = new Poco::ConsoleChannel(std::cerr); Logger::root().setChannel(channel); Logger::root().setLevel("trace"); /// Pre-initialize the `DateLUT` so that the first initialization does not affect the measured execution speed. DateLUT::instance(); Context context; context.setPath("./"); loadMetadata(context); DatabasePtr system = std::make_shared("system", "./metadata/system/"); context.addDatabase("system", system); system->loadTables(context, nullptr, false); system->attachTable("one", StorageSystemOne::create("one")); system->attachTable("numbers", StorageSystemNumbers::create("numbers")); context.setCurrentDatabase("default"); ReadBufferFromIStream in(std::cin); WriteBufferFromOStream out(std::cout); executeQuery(in, out, /* allow_into_outfile = */ false, context, {}); return 0; } catch (const Exception & e) { std::cerr << e.what() << ", " << e.displayText() << std::endl << std::endl << "Stack trace:" << std::endl << e.getStackTrace().toString(); return 1; }