[cloud-spanner-leaderboard-java]:
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 68/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- google-cloud, java
- Domain
- documentation
Research direction
In the codelab's “5. Load Data” section, compare the Java snippet and App.java stack trace with the linked Cloud Spanner commit-timestamp documentation. Update the instructions so the documented operation matches the API behavior, then verify the sample's timestamp insertion no longer produces the reported binding exception.
Written by the indexing model from the issue text.
Description
- Load Data
To auto-populate the Timestamp column with the timestamp of exactly when the "Insert" transaction takes place, you can instead insert the Java constant Value.COMMIT_TIMESTAMP like in the following code snippet:
.bind("Timestamp")
.to(Value.COMMIT_TIMESTAMP)
This is instruction doesn't seem to be right.
Exception in thread "main" com.google.cloud.spanner.SpannerException: UNKNOWN: Mutation.COMMIT_TIMESTAMP cannot be bound as a query parameter
at com.google.cloud.spanner.SpannerExceptionFactory.newSpannerExceptionPreformatted(SpannerExceptionFactory.java:151)
at com.google.cloud.spanner.SpannerExceptionFactory.newSpannerException(SpannerExceptionFactory.java:45)
at com.google.cloud.spanner.SpannerImpl$TransactionRunnerImpl.runInternal(SpannerImpl.java:1365)
at com.google.cloud.spanner.SpannerImpl$TransactionRunnerImpl.run(SpannerImpl.java:1317)
at com.google.cloud.spanner.SessionPool$PooledSession$1.run(SessionPool.java:408)
at com.google.codelabs.App.insertScores(App.java:118)
at com.google.codelabs.App.insert(App.java:59)
at com.google.codelabs.App.main(App.java:247)
Caused by: java.lang.IllegalArgumentException: Mutation.COMMIT_TIMESTAMP cannot be bound as a query parameter
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:141)
at com.google.cloud.spanner.Statement$Builder$Binder.handle(Statement.java:103)
at com.google.cloud.spanner.Statement$Builder$Binder.handle(Statement.java:100)
at com.google.cloud.spanner.ValueBinder.to(ValueBinder.java:99)
at com.google.codelabs.App$2.run(App.java:155)
at com.google.codelabs.App$2.run(App.java:119)
at com.google.cloud.spanner.SpannerImpl$TransactionRunnerImpl.runInternal(SpannerImpl.java:1349)
As per doc[1], mutation instead of statement should be used in such case.
https://cloud.google.com/spanner/docs/commit-timestamp#insert-row
- Dominant language
- No language data
- Stars
- 30
- Forks
- 60
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from googlecodelabs/feedback
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
googlecodelabs/feedback#2243 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
googlecodelabs/feedback#2237 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
googlecodelabs/feedback#2225 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 65/100
googlecodelabs/feedback#1675 · 1 reaction ·
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
googlecodelabs/feedback#1479 ·
All issues in googlecodelabs/feedback
Similar issues
-
user-reported
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Kong/developer.konghq.com#7316 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Ecosystem: ClawMetry — the Qwen Code reader is now free and open source (follow-up to #9294 / #9338) Opencategory/integration priority/P3 scope/documentation status/ready-for-human type/feature-request
Difficulty 1/5 Under an hour Newbie friendliness 84/100