aerospike / aerospike-mod-lua Goto Github PK
View Code? Open in Web Editor NEWLua Interface Module for Aerospike Server and C Client
Home Page: http://aerospike.com
Lua Interface Module for Aerospike Server and C Client
Home Page: http://aerospike.com
Client: Python 3.7.2
Server: 3.16
When saving records, we have the option to mark a bin as None (in which case, the bin is not stored). Other option is to mark the bin value as aerospike.null(). The client gets back aerospike.null() as the value for the bin. This clearly distinguishes omitted bins vs null bins.
The bin is also stored in the server when using aerospike.null().
This cannot be done with a udf, since _record[bin] always results in nil
and record.bin_names also does not return name for this bin. This is sort of inconsistent. If record.bin_names returns the bin name, we can do the above mentioned check in udf too.
Is there any way short of passing expected bin names to udf and checking against that to solve this issue? Or, if viable this be made a feature request.
This seems to be because for these bins as_bin_inuse returns false, if I understand the code correct.
https://github.com/aerospike/aerospike-server/blob/2b99c53f71d2da4782d4c5111243b7db395ea618/as/src/base/udf_record.c#L886
Also, does aerospike plan to expose geojson's in udf with geo query feature?
Please let me know, if this issue does not belong in this repo and should be moved to aerospike-server repo.
Hello,
In the docs http://www.aerospike.com/docs/udf/api/bytes.html is told that
> local b = bytes(18)
Bytes()
> b[1]
0
but when I do
function test(rec, bin)
local a = bytes(10)
return a[1]
end
and
aql> register module 'bytes_test.lua'
OK, 1 module added.
aql> execute bytes_test.test() on scan.b_test where PK = 1
+------+
| test |
+------+
| |
+------+
1 row in set (0.000 secs)
I get nil
I looked to the code, and https://github.com/aerospike/aerospike-common/blob/master/src/main/aerospike/as_bytes.c#L33 calls wrapped calloc https://github.com/aerospike/aerospike-common/blob/9c595786295be4a9396abed37d61d65e4a89a89d/src/main/citrusleaf/cf_alloc.c#L32 which should initialize memory to 0.
But I think that when pushing memory to lua this function is used
aerospike-mod-lua/src/main/mod_lua_val.c
Line 217 in d0fba23
I found this confusing, maybe mentioning it in the documentation is worth it:
> local l = list {1,nil,3}
List(1,3)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.