You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@arrow.apache.org by Sanjay Rao <ge...@live.com> on 2016/08/01 06:54:35 UTC

Can someone help me how should I start using Arrow Java Jars ?

Awaiting your reply.
Thanks,Sanjay 		 	   		  

Re: Can someone help me how should I start using Arrow Java Jars ?

Posted by Ted Dunning <te...@gmail.com>.
Cloning the git repository gives you the full source code.



On Mon, Aug 1, 2016 at 8:11 AM, Sanjay Rao <ge...@live.com> wrote:

> Hi Kiril,
> Thanks a lot for your reply, Can I have the full source code ? It would
> help me, also could you help me with Java doc link if any as such.
> Thanks again,Sanjay
>
> > From: kmenshikov@gmail.com
> > Date: Mon, 1 Aug 2016 16:37:52 +0300
> > Subject: Re: Can someone help me how should I start using Arrow Java
> Jars ?
> > To: dev@arrow.apache.org
> >
> > Hi Sanjay,
> >
> > You need to check out latest arrow:
> >
> > git clone https://github.com/apache/arrow
> >
> > Go to the java folder and run maven:
> >
> > mvn install
> >
> > After you will find two jars:
> > memory/target/arrow-memory-0.1-SNAPSHOT.jar
> > vector/target/vector-0.1-SNAPSHOT.jar
> >
> > Arrow example:
> > BufferAllocator allocator = new RootAllocator(Long.MAX_VALUE);
> >
> > MaterializedField field = MaterializedField.create("list",
> > Types.optional(MinorType.LIST));
> > ListVector list = new ListVector(field, allocator, null);
> > list.allocateNew();
> > list.getWriter().startList();
> > FieldWriter writer = list.getWriter();
> > // crate var charholdig to save string
> > VarCharHolder vh = new VarCharHolder();
> > byte[] bytes = null;
> > try {
> > bytes = txt.getBytes("UTF-8");
> > } catch (UnsupportedEncodingException e1) {
> > e1.printStackTrace();
> > }
> > if(bytes != null) {
> > try (ArrowBuf buf = allocator.buffer(bytes.length)) {
> > buf.setBytes(0, bytes, 0, bytes.length);
> > vh.buffer = buf;
> > vh.start = 0;
> > vh.end = bytes.length;
> > // write string
> > writer.varChar(name).write(vh);
> > }
> > }
> > // write num
> > writer.integer("age").writeInt(21);
> >
> > list.getWriter().endList();
> >
> > list.clear();
> > list.close();
> >
> > allocator.close();
> >
> >
> > -Kiril
> >
> > On 1 August 2016 at 09:54, Sanjay Rao <ge...@live.com> wrote:
> >
> > > Awaiting your reply.
> > > Thanks,Sanjay
> >
> >
> >
> >
> > --
> > Thanks,
> > -Kiril
> > Phone +37126409291
> > Riga, Latvia
> > Skype perimetr122
>
>

RE: Can someone help me how should I start using Arrow Java Jars ?

Posted by Sanjay Rao <ge...@live.com>.
Hi Kiril,
Thanks a lot for your reply, Can I have the full source code ? It would help me, also could you help me with Java doc link if any as such.
Thanks again,Sanjay

> From: kmenshikov@gmail.com
> Date: Mon, 1 Aug 2016 16:37:52 +0300
> Subject: Re: Can someone help me how should I start using Arrow Java Jars ?
> To: dev@arrow.apache.org
> 
> Hi Sanjay,
> 
> You need to check out latest arrow:
> 
> git clone https://github.com/apache/arrow
> 
> Go to the java folder and run maven:
> 
> mvn install
> 
> After you will find two jars:
> memory/target/arrow-memory-0.1-SNAPSHOT.jar
> vector/target/vector-0.1-SNAPSHOT.jar
> 
> Arrow example:
> BufferAllocator allocator = new RootAllocator(Long.MAX_VALUE);
> 
> MaterializedField field = MaterializedField.create("list",
> Types.optional(MinorType.LIST));
> ListVector list = new ListVector(field, allocator, null);
> list.allocateNew();
> list.getWriter().startList();
> FieldWriter writer = list.getWriter();
> // crate var charholdig to save string
> VarCharHolder vh = new VarCharHolder();
> byte[] bytes = null;
> try {
> bytes = txt.getBytes("UTF-8");
> } catch (UnsupportedEncodingException e1) {
> e1.printStackTrace();
> }
> if(bytes != null) {
> try (ArrowBuf buf = allocator.buffer(bytes.length)) {
> buf.setBytes(0, bytes, 0, bytes.length);
> vh.buffer = buf;
> vh.start = 0;
> vh.end = bytes.length;
> // write string
> writer.varChar(name).write(vh);
> }
> }
> // write num
> writer.integer("age").writeInt(21);
> 
> list.getWriter().endList();
> 
> list.clear();
> list.close();
> 
> allocator.close();
> 
> 
> -Kiril
> 
> On 1 August 2016 at 09:54, Sanjay Rao <ge...@live.com> wrote:
> 
> > Awaiting your reply.
> > Thanks,Sanjay
> 
> 
> 
> 
> -- 
> Thanks,
> -Kiril
> Phone +37126409291
> Riga, Latvia
> Skype perimetr122
 		 	   		  

Re: Can someone help me how should I start using Arrow Java Jars ?

Posted by Kiril Menshikov <km...@gmail.com>.
Hi Sanjay,

You need to check out latest arrow:

git clone https://github.com/apache/arrow

Go to the java folder and run maven:

mvn install

After you will find two jars:
memory/target/arrow-memory-0.1-SNAPSHOT.jar
vector/target/vector-0.1-SNAPSHOT.jar

Arrow example:
BufferAllocator allocator = new RootAllocator(Long.MAX_VALUE);

MaterializedField field = MaterializedField.create("list",
Types.optional(MinorType.LIST));
ListVector list = new ListVector(field, allocator, null);
list.allocateNew();
list.getWriter().startList();
FieldWriter writer = list.getWriter();
// crate var charholdig to save string
VarCharHolder vh = new VarCharHolder();
byte[] bytes = null;
try {
bytes = txt.getBytes("UTF-8");
} catch (UnsupportedEncodingException e1) {
e1.printStackTrace();
}
if(bytes != null) {
try (ArrowBuf buf = allocator.buffer(bytes.length)) {
buf.setBytes(0, bytes, 0, bytes.length);
vh.buffer = buf;
vh.start = 0;
vh.end = bytes.length;
// write string
writer.varChar(name).write(vh);
}
}
// write num
writer.integer("age").writeInt(21);

list.getWriter().endList();

list.clear();
list.close();

allocator.close();


-Kiril

On 1 August 2016 at 09:54, Sanjay Rao <ge...@live.com> wrote:

> Awaiting your reply.
> Thanks,Sanjay




-- 
Thanks,
-Kiril
Phone +37126409291
Riga, Latvia
Skype perimetr122