Skip to content

Commit

Permalink
[blog] Fix typo in blogpost
Browse files Browse the repository at this point in the history
This patch adds a missing space for Backup and Restore heading and
uniform some line spacings.

Change-Id: Iec743b5151ac9c139d3b3513f99d0369cfe0fc93
Reviewed-on: http://gerrit.cloudera.org:8080/21378
Tested-by: Abhishek Chennaka <[email protected]>
Reviewed-by: Mahesh Reddy <[email protected]>
Reviewed-by: Alexey Serbin <[email protected]>
  • Loading branch information
achennaka authored and martongreber committed May 7, 2024
1 parent b7bf6b0 commit a71b5b5
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions _posts/2024-03-07-introducing-auto-incrementing-column.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ SELECT \*, auto_incrementing_id FROM &lt;tablename&gt;
#### Examples

Create a table with two columns and two hash partitions:

```
default> CREATE TABLE demo_table(id INT NON UNIQUE PRIMARY KEY, name STRING) PARTITION BY HASH (id) PARTITIONS 2 STORED AS KUDU;
Query: CREATE TABLE demo_table(id INT NON UNIQUE PRIMARY KEY, name STRING) PARTITION BY HASH (id) PARTITIONS 2 STORED AS KUDU
Expand All @@ -66,7 +65,6 @@ Fetched 1 row(s) in 3.94s
```

Describe the table:

```
default> DESCRIBE demo_table;
Query: DESCRIBE demo_table
Expand All @@ -79,16 +77,15 @@ Query: DESCRIBE demo_table
+----------------------+--------+---------+-------------+------------+----------+---------------+---------------+---------------------+------------+
```

<br/>Insert rows with duplicate partial primary key column values:

Insert rows with duplicate partial primary key column values:
```
default> INSERT INTO demo_table VALUES (1, 'John'), (2, 'Bob'), (3, 'Mary'), (1, 'Joe');
Query: INSERT INTO demo_table VALUES (1, 'John'), (2, 'Bob'), (3, 'Mary'), (1, 'Joe')
..
Modified 4 row(s), 0 row error(s) in 0.41s
```
<br/>Scan the table (notice the duplicate values in the 'id' column):

Scan the table (notice the duplicate values in the 'id' column):
```
default> SELECT * FROM demo_table;
Query: SELECT * FROM demo_table
Expand Down Expand Up @@ -132,6 +129,7 @@ default> DELETE FROM demo_table where id=2;
Query: DELETE FROM demo_table where id=2;
Modified 1 row(s), 0 row error(s) in 1.40s
```

Scan all the columns of the table:
```
default> SELECT *, auto_incrementing_id FROM demo_table;
Expand All @@ -146,12 +144,13 @@ Query: SELECT *, auto_incrementing_id FROM demo_table
+----+------+----------------------+
Fetched 3 row(s) in 0.20s
```

#### Limitations

Impala doesn’t support UPSERT operations on tables with the auto-incrementing column as of writing
this article.

### Kudu clients(Java, C++, Python)
### Kudu clients (Java, C++, Python)

Unlike in Impala, scanning the table fetches all the table data including the auto incrementing column.
There is no need to explicitly request the auto-incrementing column.
Expand All @@ -166,7 +165,7 @@ regular UPDATE operation. If the row is not present, it is considered an INSERT

<https://github.com/apache/kudu/blob/master/examples/python/basic-python-example/non_unique_primary_key.py>

##Backup and Restore
## Backup and Restore

The Kudu backup tool from Kudu 1.17 and later supports backing up tables with the
auto-incrementing column. The prior backup tools will fail with an error message -
Expand All @@ -175,4 +174,4 @@ auto-incrementing column. The prior backup tools will fail with an error message
The backed up data (from Kudu 1.17 and later) includes the auto-incrementing column in the table
schema and the column values as well. Restoring this backed up table with the Kudu restore tool
will create a table with the auto-incrementing column and the column values identical to the
original source table.
original source table.

0 comments on commit a71b5b5

Please sign in to comment.