Questions tagged [google-cloud-spanner]

Google Cloud Spanner is a relational, highly scalable, managed, database service. Cloud Spanner solves the need for a horizontally-scaling database with consistent global ACID transactions and SQL semantics

Google Cloud Spanner is the first and only relational database service that is both strongly consistent and horizontally scalable. Features include:

  • ACID transactions,
  • Relational schemas (and schema changes without downtime),
  • SQL queries, high performance,
  • Automatic scaling for horizontal scalability to hundreds or thousands of servers
  • Synchronous data replication, and node redundancy
  • Up to 99.999% (five 9s) of availability
  • Based upon the published Spanner research paper

Stack Overflow is Google's official community support channel for development questions.

Please include the appropriate client library language tag (, , , or ) with your question. You can also include the platform tag (, , or ).

647 questions
4
votes
2 answers

Error using SpannerIO in apache beam

This question is a follow-up to this one. I am trying to use apache beam to read data from a google spanner table (and then do some data processing). I wrote the following minimum example using the java SDK: package…
4
votes
1 answer

google Cloud spanner java.lang.IllegalArgumentException: Jetty ALPN/NPN has not been properly configured

I am new to the Google cloud Spanner and to explore it I started with documentation provided by google Here. To explore any database we start with data operations and the same I did, I started with writing data to the spanner using simple java…
4
votes
1 answer

Does Google Cloud Spanner support compression?

Our dataset has rows which are highly compressible with respect to adjacent rows. As I understand it, Bigtable supports automatic compression (via SSTable block compression). It would make a huge difference to us if Spanner can or will support…
4
votes
2 answers

Google-Cloud: Jetty ALPN/NPN has not been properly configured

Getting exception whilst using Google Pubsub to list topics, my web application is running on tomcat. public static List listTopics(GcpCredentials gcCredentials, String project) throws GCPException, IOException { List topics =…
4
votes
1 answer

How to bind to IN parameters in Cloud Spanner Java API

Is it possible, using the Google Cloud Spanner Java SDK, to bind to the parameters supplied to the IN portion of a query? e.g. List names = new ArrayList(); names.add("Alice"); names.add("Bob"); String sql = "SELECT * FROM people…
user3707
  • 1,470
  • 2
  • 15
  • 21
4
votes
2 answers

Does Google Cloud Spanner support arbitrary many-to-many relationships?

This should be doable with foreign keys, but I'm scouring through the docs but I can't seem to find anything about foreign keys in it. It looks like the only kind of relationship supported by Cloud Spanner is the interleaved-table relationship...…
4
votes
2 answers

Cloud spanner: select count * takes over a minute

I created a test table in cloud spanner and populated it with 120 million rows. i have created a composite primary key for the table. when i run a simple "select count(*) from " query, it takes approximately a minute for cloud spanner web UI to…
4
votes
1 answer

What is data locality and why does it matter in Cloud Spanner vs. MySQL?

Data locality and root tables aren't a concept in MySQL or PostgreSQL, so why do they matter in Cloud Spanner. It appears that picking primary keys is very important in your schema design for Cloud Spanner.
4
votes
1 answer

Query a Array in google cloud spanner

How can i query an array in google cloud spanner? I have tried this let query = { sql:`SELECT id, name, description FROM articles WHERE lang = '` + req.swagger.params.lang.value + `' AND tags ARRAY['` + req.swagger.params.tag.value +…
Aron
  • 1,179
  • 15
  • 29
4
votes
1 answer

How do I implement pagination?

I have a People table (Id, first_name, last_name), where the primary key is id. I want to be able to look up the first N people in the table ordered by (last_name, first_name, Id). In some cases, I need to lookup the next N people, and so on. I want…
Mike Curtiss
  • 1,838
  • 2
  • 17
  • 33
4
votes
3 answers

Google Cloud Spanner for Development

Is there a way to setup a Development env for Google Cloud Spanner? Is this this "How to run Cloud Spanner in a Container" for dev? Or is the only solution to run a cloud spanner for dev a single node? I think this is really expensive for dev.
Aron
  • 1,179
  • 15
  • 29
3
votes
2 answers

Spanner DB query on Array type column

I wanted to write a select query to fetch all the records but I am getting error if I try to match more than one type against a array type column, for example Below query is working SELECT * FROM Car where ("Ford") IN UNNEST (cartype) But this…
sKarwasra
  • 45
  • 2
3
votes
1 answer

Google cloud spanner do a full table scan regardless of the definced index

it looks like the optimizer is doing table scan instead of index scan if I select columns that are not part of the index!. I created the following table and index CREATE TABLE customer_lastseen_products ( customer_ref_value STRING(50) NOT NULL, …
Omar Ahmed
  • 53
  • 3
3
votes
1 answer

Investigating Google Cloud Spanner Latency - are secondary indexes locking?

I have an application which inserts hundreds of thousands of rows (each with only 3 columns) to spanner using the following code ran concurrently with batches of 5000. public async Task ExecuteBatchInsertOrReplaceAsync(List items,…
3
votes
1 answer

`ROUND()` function returns unexpected value

I found in a specific case spanner's ROUND() function returns unexpected value. Here's what I found. SELECT ROUND(34.092135, 8) > 34.092135 SELECT ROUND(34.092136, 8) > 34.092135999999996 // this is supposed to return 34.092136 SELECT…
souki aoba
  • 67
  • 4
1 2
3
43 44