Skip to content

Commit 887620b

Browse files
Add information about no primary key spanner table
1 parent 2b3196b commit 887620b

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

docs/Spanner-batchsink.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ Each record is composed of columns (also called fields).
4242
Every table is defined by a schema that describes the column names, data types, and other information.
4343
If the table does not exist, it will get created.
4444

45+
**Note**: A table with no primary key columns can have only one row.
46+
Only GoogleSQL-dialect databases can have tables without a primary key.
47+
Please click [here](https://cloud.google.com/spanner/docs/schema-and-data-model) for more details.
48+
4549
**Primary Key**: If the table does not exist, a primary key must be provided in order to auto-create the table.
4650
The key can be a composite key of multiple fields in the schema. This is not required if the table already exists.
4751

src/main/java/io/cdap/plugin/gcp/spanner/sink/SpannerSinkConfig.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ public class SpannerSinkConfig extends PluginConfig {
5757
private static final String NAME_CMEK_KEY = "cmekKey";
5858

5959
@Name(NAME_TABLE)
60-
@Description("Cloud Spanner table id. Uniquely identifies your table within the Cloud Spanner database")
60+
@Description("Cloud Spanner table id. Uniquely identifies your table within the Cloud Spanner database."
61+
+ " Note: A table with no primary key columns can have only one row."
62+
+ " Only GoogleSQL-dialect databases can have tables without a primary key."
63+
+ " Please refer to https://cloud.google.com/spanner/docs/schema-and-data-model for more details.")
6164
@Macro
6265
private String table;
6366

0 commit comments

Comments
 (0)