phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dumindu Buddhika <dumindukarunathil...@gmail.com>
Subject Implementing ARRAY_APPEND built-in function
Date Sat, 07 Mar 2015 01:16:21 GMT
Hi all,

I am a GSOC aspirant this year from Department of Computer Science and
Engineering, University of Moratuwa, Sri Lanka.

I would like to work on PHOENIX-1665, to create missing array built-in
functions. I am currently trying to implement ARRAY_APPEND function. I have
some questions associated with this. It would be great if someone can
answer.
PBinaryArray type would be first input of this function. Second would be a
primitive type element to be appended to the first given array. So I am
guessing it should be PDataType.

The approach I thought was using  PDataType's toObject method to construct
a PhoenixArray from given bytes(from ptr) and add the new element to it
then convert it back to bytes.

When using this approach I have a problem how to convert the second input
argument(the element to be appended to the array) to corresponding object.
if the type of this is known of this input for sure it can be done( ex: if
its PInteger then PInteger.INSTANCE.getCodec().decodeInt can be used). But
here it can be any of the primitive types to my understanding. so how to
convert to the corresponding datatype object without exactly knowing the
type?

It would be really great if someone can help me on this. if this approach
is wrong or if there is a better approach(directly manipulating bytes) I
would also like to know :)

Thank you.

Regards,
Dumindu.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message