Giter Site home page Giter Site logo

Comments (10)

AlexAkulov avatar AlexAkulov commented on August 22, 2024

Hello!
Please, write output of these commands:
select create_table_query,partition_key,primary_key from system.tables where name='tmp_employee'
select * from system.parts where table='tmp_employee' limit 100

from clickhouse-backup.

PunshiB avatar PunshiB commented on August 22, 2024

Executing select statement together was throwing exception so I fired individually..

  1. select create_table_query from system.tables where name='tmp_employee';

┌─create_table_query──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ CREATE TABLE default.tmp_employee ( name String,  age UInt32,  joining_date Date,  designation String) ENGINE = MergeTree() PARTITION BY toYYYYMM(joining_date) ORDER BY name SETTINGS index_granularity = 8192 │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘


  1. select partition_key from system.tables where name='tmp_employee';
  2. select primary_key from system.tables where name='tmp_employee';

Code: 47. DB::Exception: Received from localhost:9000, ::1. DB::Exception: Unknown identifier: partition_key.
Code: 47. DB::Exception: Received from localhost:9000, ::1. DB::Exception: Unknown identifier: primary_key.
  1. select * from system.parts where table='tmp_employee' limit 100


┌─partition─┬─name─────────┬─active─┬─marks─┬─marks_size─┬─rows─┬─bytes─┬───modification_time─┬─────────remove_time─┬─refcount─┬───min_date─┬───max_date─┬─min_block_number─┬─max_block_number─┬─level─┬─primary_key_bytes_in_memory─┬─primary_key_bytes_in_memory_allocated─┬─database─┬─table────────┬─engine────┬─path─────────────────────────────────────────────────────────┐
│ 199401    │ 199401_3_3_0 │      1 │     1 │         64 │    1 │   716 │ 2019-05-01 14:28:13 │ 0000-00-00 00:00:00 │        1 │ 1994-01-01 │ 1994-01-01 │                3 │                3 │     0 │                          14 │                                  4128 │ default  │ tmp_employee │ MergeTree │ /motadata/clickhouse/data/default/tmp_employee/199401_3_3_0/ │
│ 201006    │ 201006_1_1_0 │      1 │     1 │         64 │    2 │   730 │ 2019-05-01 14:28:13 │ 0000-00-00 00:00:00 │        1 │ 2010-06-01 │ 2010-06-10 │                1 │                1 │     0 │                          15 │                                  4128 │ default  │ tmp_employee │ MergeTree │ /motadata/clickhouse/data/default/tmp_employee/201006_1_1_0/ │
│ 201306    │ 201306_2_2_0 │      1 │     1 │         64 │    1 │   711 │ 2019-05-01 14:28:13 │ 0000-00-00 00:00:00 │        1 │ 2013-06-01 │ 2013-06-01 │                2 │                2 │     0 │                          14 │                                  4128 │ default  │ tmp_employee │ MergeTree │ /motadata/clickhouse/data/default/tmp_employee/201306_2_2_0/ │
└───────────┴──────────────┴────────┴───────┴────────────┴──────┴───────┴─────────────────────┴─────────────────────┴──────────┴────────────┴────────────┴──────────────────┴──────────────────┴───────┴─────────────────────────────┴───────────────────────────────────────┴──────────┴──────────────┴───────────┴──────────────────────────────────────────────────────────────┘

3 rows in set. Elapsed: 0.023 sec. 

I figured out the problem there isn't partition_id column in system.parts table but I don't know why , what could be the alternative of partition_id column ?

from clickhouse-backup.

AlexAkulov avatar AlexAkulov commented on August 22, 2024

What version of ClickHouse do you use?

from clickhouse-backup.

PunshiB avatar PunshiB commented on August 22, 2024

Here is every detail-

Details-
Ubuntu 16.04 LTS
Clickhouse version- 1.1.54370
Clickhouse-backup (latest 26Apr2019)

from clickhouse-backup.

AlexAkulov avatar AlexAkulov commented on August 22, 2024

This is very old version of ClickHouse. I have found out that clickhouse-backup works correctly since ClickHouse version 19.1.5 or above.
Can do you upgrade your clickhouse?

from clickhouse-backup.

PunshiB avatar PunshiB commented on August 22, 2024

Yes the version is quite old, for some reasons I cannot upgrade the clickhouse atleast for my current project, I was thinking of replacing partition_id with something else ,I am actually analysing columns for that do you have any suggestions which could be a possible replacement for partition_id?

from clickhouse-backup.

PunshiB avatar PunshiB commented on August 22, 2024

I did some modification in sql queries replaced partition_id with partition and accordingly modified ALTER queries but now I am stuck with some other error, is it ok to continue on this or so should I close this thread and start new one?

The error -


2019/05/02 20:46:00 Copy metadata
2019/05/02 20:46:00 can't backup metadata with stat /punshi/clickhouse/metadata: no such file or directory

I should say I have modified the config and I am trying to backup data of remote server. The above address does exist on remote machine for which I am taking backup but not on mine from where I am running the utility.
Thanks

from clickhouse-backup.

AlexAkulov avatar AlexAkulov commented on August 22, 2024

The error on copy metadata is a bug and it was fixed in v0.3.1
Thank you for report!

from clickhouse-backup.

AlexAkulov avatar AlexAkulov commented on August 22, 2024

It's possible to use partition instead of partiotion_id for old versions of ClickHouse but it requires code modification. I don't know when I can fix it.

from clickhouse-backup.

PunshiB avatar PunshiB commented on August 22, 2024

Well thanks for all this effort, I have modified the queries and its working partially I am stuck with some other error so I will close this ticket and raise another. If you want I can upload my changes once everything is working..

from clickhouse-backup.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.