Advertisement
kopyl

Untitled

Jun 9th, 2021
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.83 KB | None | 0 0
  1. Traceback (most recent call last):
  2. File "/Users/olehkopyl/Dropbox/Development/Python/cdict/sandbox.py", line 3565, in <module>
  3. client.execute(
  4. File "/usr/local/lib/python3.8/site-packages/clickhouse_driver/client.py", line 267, in execute
  5. rv = self.process_ordinary_query(
  6. File "/usr/local/lib/python3.8/site-packages/clickhouse_driver/client.py", line 453, in process_ordinary_query
  7. return self.receive_result(with_column_types=with_column_types,
  8. File "/usr/local/lib/python3.8/site-packages/clickhouse_driver/client.py", line 117, in receive_result
  9. return result.get_result()
  10. File "/usr/local/lib/python3.8/site-packages/clickhouse_driver/result.py", line 50, in get_result
  11. for packet in self.packet_generator:
  12. File "/usr/local/lib/python3.8/site-packages/clickhouse_driver/client.py", line 133, in packet_generator
  13. packet = self.receive_packet()
  14. File "/usr/local/lib/python3.8/site-packages/clickhouse_driver/client.py", line 150, in receive_packet
  15. raise packet.exception
  16. clickhouse_driver.errors.ServerException: Code: 42.
  17. DB::Exception: Storage MergeTree requires 3 to 4 parameters:
  18. name of column with date,
  19. [sampling element of primary key],
  20. primary key expression,
  21. index granularity
  22.  
  23. Syntax for the MergeTree table engine:
  24.  
  25. CREATE TABLE [IF NOT EXISTS] [db.]table_name [ON CLUSTER cluster]
  26. (
  27. name1 [type1] [DEFAULT|MATERIALIZED|ALIAS expr1] [TTL expr1],
  28. name2 [type2] [DEFAULT|MATERIALIZED|ALIAS expr2] [TTL expr2],
  29. ...
  30. INDEX index_name1 expr1 TYPE type1(...) GRANULARITY value1,
  31. INDEX index_name2 expr2 TYPE type2(...) GRANULARITY value2
  32. ) ENGINE = MergeTree()
  33. ORDER BY expr
  34. [PARTITION BY expr]
  35. [PRIMARY KEY expr]
  36. [SAMPLE BY expr]
  37. [TTL expr [DELETE|TO DISK 'xxx'|TO VOLUME 'xxx'], ...]
  38. [SETTINGS name=value, ...]
  39.  
  40. See details in documentation: https://clickhouse.tech/docs/en/engines/table-engines/mergetree-family/mergetree/. Other engines of the family support different syntax, see details in the corresponding documentation topics.
  41.  
  42. If you use the Replicated version of engines, see https://clickhouse.tech/docs/en/engines/table-engines/mergetree-family/replication/.
  43. . Stack trace:
  44.  
  45. 0. DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, bool) @ 0x8b5b17a in /usr/bin/clickhouse
  46. 1. ? @ 0x102eb130 in /usr/bin/clickhouse
  47. 2. DB::StorageFactory::get(DB::ASTCreateQuery const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<DB::Context>, std::__1::shared_ptr<DB::Context>, DB::ColumnsDescription const&, DB::ConstraintsDescription const&, bool) const @ 0xfdce3e1 in /usr/bin/clickhouse
  48. 3. DB::InterpreterCreateQuery::doCreateTable(DB::ASTCreateQuery&, DB::InterpreterCreateQuery::TableProperties const&) @ 0xf63204f in /usr/bin/clickhouse
  49. 4. DB::InterpreterCreateQuery::createTable(DB::ASTCreateQuery&) @ 0xf62e4ce in /usr/bin/clickhouse
  50. 5. DB::InterpreterCreateQuery::execute() @ 0xf634187 in /usr/bin/clickhouse
  51. 6. ? @ 0xfbc0da1 in /usr/bin/clickhouse
  52. 7. DB::executeQuery(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<DB::Context>, bool, DB::QueryProcessingStage::Enum, bool) @ 0xfbbf423 in /usr/bin/clickhouse
  53. 8. DB::TCPHandler::runImpl() @ 0x103e5eb2 in /usr/bin/clickhouse
  54. 9. DB::TCPHandler::run() @ 0x103f8db9 in /usr/bin/clickhouse
  55. 10. Poco::Net::TCPServerConnection::start() @ 0x129f64af in /usr/bin/clickhouse
  56. 11. Poco::Net::TCPServerDispatcher::run() @ 0x129f7f3a in /usr/bin/clickhouse
  57. 12. Poco::PooledThread::run() @ 0x12b31f39 in /usr/bin/clickhouse
  58. 13. Poco::ThreadImpl::runnableEntry(void*) @ 0x12b2df2a in /usr/bin/clickhouse
  59. 14. start_thread @ 0x9609 in /usr/lib/x86_64-linux-gnu/libpthread-2.31.so
  60. 15. __clone @ 0x122293 in /usr/lib/x86_64-linux-gnu/libc-2.31.so
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement