Comments (7)
I was able to reproduce.
cc @kolodny
from nodejs-bigtable.
I was able to repro too. This bug doesn't seem new though since I was able to repro as far back as v0.10.2. It appears the only difference is that having bools in the data used to throw TypeError: Illegal buffer
and after #35 it just puts it bools in as empty strings.
What is the current state with booleans in Bigtable? Does it get encoded in some special way that we can encode/decode when writing/reading that value?
cc @sduskis
from nodejs-bigtable.
Here's the gapic ReadRowsResponse
for inserting a decimal, 1.23
:
{
"chunks": [
{
"labels": [],
"rowKey": {
"type": "Buffer",
"data": [
103,
119,
97,
115,
104,
105,
110,
103,
116,
111,
110
]
},
"familyName": {
"value": "follows"
},
"qualifier": {
"value": {
"type": "Buffer",
"data": [
106,
97,
100,
97,
109,
115
]
}
},
"timestampMicros": "1524072042604000",
"value": {
"type": "Buffer",
"data": [
0,
0,
0,
0,
0,
0,
0,
1
]
},
"valueSize": 0,
"commitRow": true,
"rowStatus": "commitRow"
}
],
"lastScannedRowKey": []
}
And for true
:
{
"chunks": [
{
"labels": [],
"rowKey": {
"type": "Buffer",
"data": [
103,
119,
97,
115,
104,
105,
110,
103,
116,
111,
110
]
},
"familyName": {
"value": "follows"
},
"qualifier": {
"value": {
"type": "Buffer",
"data": [
106,
97,
100,
97,
109,
115
]
}
},
"timestampMicros": "1524071811968000",
"value": [],
"valueSize": 0,
"commitRow": true,
"rowStatus": "commitRow"
}
],
"lastScannedRowKey": []
}
At this point, it seems impossible to derive 1.23
from value: [0, 0, 0, 0, 0, 0, 0, 1]
and true
from value: []
.
from nodejs-bigtable.
Bigtable stores all it's fields in binary with no encoding information. The typical way to put data inside bigtable or extract it out is by manually doing the encoding/decoding. The library currently helps out by converting numbers to Buffers otherwise it just passes whatever the value is to Buffer.from
and hopes for the best. Ideally every field should be encoded before being passed to table.mutate
.
In the future we may consider allowing passing some Mutation like API to simplify the encoding/decoding actions to and from the table
from nodejs-bigtable.
One thing to note based on the above, any data previously entered in that fashion should be considered bad and should be deleted
I'll close this issue for now, feel free to reopen if you have any followup questions or issues
from nodejs-bigtable.
Thanks. I would consider throwing on everything except string buffer and null/undefined instead of potentially storing bad values. After testing to see that string/int works you may move on thinking that also bool and decimal works (like I almost did).
from nodejs-bigtable.
Thanks @moander, I opened #102 to get a discussion about that point started.
from nodejs-bigtable.
Related Issues (20)
- Bigtable: "after all" hook in "Bigtable" failed HOT 1
- deletes: "before all" hook for "should delete column from a row" failed
- filters: "before all" hook for "should filter with row sample" failed
- filters: "after all" hook for "should filter with condition" failed HOT 1
- reads: "before all" hook for "should read one row" failed
- writes: "before all" hook for "should do a simple write" failed
- The build failed
- Cluster: "after each" hook for "should change nodes for manual scaling" failed
- Bigtable column families: should create a family with nested gc rules failed HOT 1
- 📦 pack-n-play test: TypeScript code failed HOT 3
- Bigtable/Table close: should fail when invoking readRows with closed client failed HOT 1
- Bigtable/Table close: "after all" hook for "should fail when invoking readRows with closed client" failed HOT 4
- Cluster Create cluster With manual scaling: "before each" hook for "should throw an error when missing all autoscaling configurations" failed
- deletes: "before all" hook for "should delete column from a row" failed
- Bigtable rows .exists(): "before each" hook for "should check if a row exists" failed
- Read Row Format HOT 1
- 📦 pack-n-play test: TypeScript code failed HOT 1
- 📦 pack-n-play test: JavaScript code failed HOT 1
- Bigtable/ReadRows: should silently resume after server or network error failed HOT 1
- Table.create() is really slow when using the bigatble emulator
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nodejs-bigtable.