-
Notifications
You must be signed in to change notification settings - Fork 639
Closed
Labels
api: bigtableIssues related to the Bigtable API.Issues related to the Bigtable API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Hi, it's great to see the new Bigtable functionality added, but I am having an issue checking and creating tables.
I can successfully use table.create() and then call table.createFamily() from it's callback function, but I get an error on creation of the 'family' if I have just happened to test whether the table exists first.
Environment details
- OS: Ubuntu 16.04
- Node.js version: v6.1.0
- npm version: 3.8.6
- gcloud-node version: v0.37.0
Steps to reproduce
var table = bigtable.table('prezzy');
table.exists(function(err, exists) {
if (exists) {
console.log("Table already exists");
} else {
table.create(function(err, table, apiResponse) {
if (err) {
console.log("Error from table.create(): " + err);
} else {
console.log("Table created, now create family");
table.createFamily('follows', function(err, family) {
if (err) {
console.log("Error from table.createFamily(): " + err);
} else {
console.log("family created");
}
});
}
});
}
});In this case I get
Table created, now create family
Error from table.createFamily(): Error: Failed to read: projects/{12345678}/instances//clusters/my-cluster/tables/prezzy
If I simply remove the 'exists' test it works (obviously if the table does not exist. I am deleting the table between the tests)
var table = bigtable.table('prezzy');
table.create(function(err, table, apiResponse) {
if (err) {
console.log("Error from table.create(): " + err);
} else {
console.log("Table created, now create family");
table.createFamily('follows', function(err, family) {
if (err) {
console.log("Error from table.createFamily(): " + err);
} else {
console.log("family created");
}
});
}
});This code produces the expected result
Table created, now create family
family created
It would seem that the use of the 'exists' API call is changing the nature of the 'table' object
Metadata
Metadata
Assignees
Labels
api: bigtableIssues related to the Bigtable API.Issues related to the Bigtable API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.