davisusanibar commented on a change in pull request #12739:
URL: https://github.com/apache/arrow/pull/12739#discussion_r839007111



##########
File path: docs/source/java/examples/quickstartguide.rst
##########
@@ -0,0 +1,277 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+.. default-domain:: java
+.. highlight:: java
+
+=================
+Quick Start Guide
+=================
+
+.. contents::
+
+Arrow Java provides several building blocks; ``data types`` describe the types 
of values;
+``ValueVectors`` are sequences of typed values; ``fields`` describe the types 
of columns in
+tabular data; ``schemas`` describe a sequence of columns in tabular data and
+``VectorSchemaRoot`` represents tabular data. Arrow also provides ``readers`` 
and
+``writers`` for loading data from and persisting data to storage.
+
+Create A Value Vector
+*********************
+
+Also known as "arrays" in the columnar format. Represent a one-dimensional
+sequence of homogeneous values.
+
+**Int Vector**: Create an value vector of int32s like this [1, null, 2]
+
+.. code-block:: Java
+
+    import org.apache.arrow.memory.BufferAllocator;
+    import org.apache.arrow.memory.RootAllocator;
+    import org.apache.arrow.vector.IntVector;
+
+    try(BufferAllocator rootAllocator = new RootAllocator();
+        IntVector intVector = new IntVector("fixed-size-primitive-layout", 
rootAllocator)){
+        intVector.allocateNew(3);
+        intVector.set(0,1);
+        intVector.setNull(1);
+        intVector.set(2,2);
+        intVector.setValueCount(3);
+        System.out.println("Vector created in memory: " + intVector);
+    }
+
+**Varchar Vector**: Create an value vector of string like this [one, two, 
three]
+
+.. code-block:: Java
+
+    import org.apache.arrow.memory.BufferAllocator;
+    import org.apache.arrow.memory.RootAllocator;
+    import org.apache.arrow.vector.VarCharVector;
+
+    try(BufferAllocator rootAllocator = new RootAllocator();
+        VarCharVector varCharVector = new 
VarCharVector("variable-size-primitive-layout", rootAllocator)){
+        varCharVector.allocateNew(3);
+        varCharVector.set(0, "one".getBytes());
+        varCharVector.set(1, "two".getBytes());
+        varCharVector.set(2, "three".getBytes());
+        varCharVector.setValueCount(3);
+        System.out.println("Vector created in memory: " + varCharVector);
+    }
+
+Create A Field
+**************
+
+Fields are used to denote the particular columns of tabular data.
+
+**Field**: Create a column "document" of string type with metadata.
+
+.. code-block:: Java
+
+    import org.apache.arrow.vector.types.pojo.ArrowType;
+    import org.apache.arrow.vector.types.pojo.Field;
+    import org.apache.arrow.vector.types.pojo.FieldType;
+
+    Map<String, String> metadata = new HashMap<>();
+    metadata.put("A", "Id card");
+    metadata.put("B", "Passport");
+    metadata.put("C", "Visa");
+    Field document = new Field("document", new FieldType(true, new 
ArrowType.Utf8(), /*dictionary*/ null, metadata), /*children*/ null);
+
+Create A Schema
+***************
+
+Schema holds a sequence of fields together with some optional metadata.
+
+**Schema**: Create a schema describing datasets with two columns:
+a int32 column "A" and a utf8-encoded string column "B"
+
+.. code-block:: Java
+
+    import org.apache.arrow.vector.types.pojo.ArrowType;
+    import org.apache.arrow.vector.types.pojo.Field;
+    import org.apache.arrow.vector.types.pojo.FieldType;
+    import org.apache.arrow.vector.types.pojo.Schema;
+    import static java.util.Arrays.asList;
+
+    Map<String, String> metadata = new HashMap<>();
+    metadata.put("K1", "V1");
+    metadata.put("K2", "V2");
+    Field a = new Field("A", FieldType.nullable(new ArrowType.Int(32, true)), 
null);
+    Field b = new Field("B", FieldType.nullable(new ArrowType.Utf8()), null);
+    Schema schema = new Schema(asList(a, b), metadata);
+
+Create A VectorSchemaRoot
+***************************
+
+VectorSchemaRoot is somewhat analogous to tables and record batches in the 
other
+Arrow implementations.

Review comment:
       Added

##########
File path: docs/source/java/examples/quickstartguide.rst
##########
@@ -0,0 +1,277 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+.. default-domain:: java
+.. highlight:: java
+
+=================
+Quick Start Guide
+=================
+
+.. contents::
+
+Arrow Java provides several building blocks; ``data types`` describe the types 
of values;
+``ValueVectors`` are sequences of typed values; ``fields`` describe the types 
of columns in
+tabular data; ``schemas`` describe a sequence of columns in tabular data and
+``VectorSchemaRoot`` represents tabular data. Arrow also provides ``readers`` 
and
+``writers`` for loading data from and persisting data to storage.
+
+Create A Value Vector
+*********************
+
+Also known as "arrays" in the columnar format. Represent a one-dimensional
+sequence of homogeneous values.
+
+**Int Vector**: Create an value vector of int32s like this [1, null, 2]
+
+.. code-block:: Java
+
+    import org.apache.arrow.memory.BufferAllocator;
+    import org.apache.arrow.memory.RootAllocator;
+    import org.apache.arrow.vector.IntVector;
+
+    try(BufferAllocator rootAllocator = new RootAllocator();
+        IntVector intVector = new IntVector("fixed-size-primitive-layout", 
rootAllocator)){

Review comment:
       Changed

##########
File path: docs/source/java/examples/quickstartguide.rst
##########
@@ -0,0 +1,277 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+.. default-domain:: java
+.. highlight:: java
+
+=================
+Quick Start Guide
+=================
+
+.. contents::
+
+Arrow Java provides several building blocks; ``data types`` describe the types 
of values;
+``ValueVectors`` are sequences of typed values; ``fields`` describe the types 
of columns in
+tabular data; ``schemas`` describe a sequence of columns in tabular data and
+``VectorSchemaRoot`` represents tabular data. Arrow also provides ``readers`` 
and
+``writers`` for loading data from and persisting data to storage.
+
+Create A Value Vector
+*********************
+
+Also known as "arrays" in the columnar format. Represent a one-dimensional
+sequence of homogeneous values.
+
+**Int Vector**: Create an value vector of int32s like this [1, null, 2]
+
+.. code-block:: Java
+
+    import org.apache.arrow.memory.BufferAllocator;
+    import org.apache.arrow.memory.RootAllocator;
+    import org.apache.arrow.vector.IntVector;
+
+    try(BufferAllocator rootAllocator = new RootAllocator();
+        IntVector intVector = new IntVector("fixed-size-primitive-layout", 
rootAllocator)){
+        intVector.allocateNew(3);
+        intVector.set(0,1);
+        intVector.setNull(1);
+        intVector.set(2,2);
+        intVector.setValueCount(3);
+        System.out.println("Vector created in memory: " + intVector);
+    }

Review comment:
       Added

##########
File path: docs/source/java/examples/quickstartguide.rst
##########
@@ -0,0 +1,277 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+.. default-domain:: java
+.. highlight:: java
+
+=================
+Quick Start Guide
+=================
+
+.. contents::
+
+Arrow Java provides several building blocks; ``data types`` describe the types 
of values;
+``ValueVectors`` are sequences of typed values; ``fields`` describe the types 
of columns in
+tabular data; ``schemas`` describe a sequence of columns in tabular data and
+``VectorSchemaRoot`` represents tabular data. Arrow also provides ``readers`` 
and
+``writers`` for loading data from and persisting data to storage.
+
+Create A Value Vector
+*********************
+
+Also known as "arrays" in the columnar format. Represent a one-dimensional
+sequence of homogeneous values.
+
+**Int Vector**: Create an value vector of int32s like this [1, null, 2]
+
+.. code-block:: Java
+
+    import org.apache.arrow.memory.BufferAllocator;
+    import org.apache.arrow.memory.RootAllocator;
+    import org.apache.arrow.vector.IntVector;
+
+    try(BufferAllocator rootAllocator = new RootAllocator();
+        IntVector intVector = new IntVector("fixed-size-primitive-layout", 
rootAllocator)){
+        intVector.allocateNew(3);
+        intVector.set(0,1);
+        intVector.setNull(1);
+        intVector.set(2,2);
+        intVector.setValueCount(3);
+        System.out.println("Vector created in memory: " + intVector);
+    }
+
+**Varchar Vector**: Create an value vector of string like this [one, two, 
three]
+
+.. code-block:: Java
+
+    import org.apache.arrow.memory.BufferAllocator;
+    import org.apache.arrow.memory.RootAllocator;
+    import org.apache.arrow.vector.VarCharVector;
+
+    try(BufferAllocator rootAllocator = new RootAllocator();
+        VarCharVector varCharVector = new 
VarCharVector("variable-size-primitive-layout", rootAllocator)){
+        varCharVector.allocateNew(3);
+        varCharVector.set(0, "one".getBytes());
+        varCharVector.set(1, "two".getBytes());
+        varCharVector.set(2, "three".getBytes());
+        varCharVector.setValueCount(3);
+        System.out.println("Vector created in memory: " + varCharVector);
+    }
+
+Create A Field
+**************
+
+Fields are used to denote the particular columns of tabular data.
+
+**Field**: Create a column "document" of string type with metadata.
+
+.. code-block:: Java
+
+    import org.apache.arrow.vector.types.pojo.ArrowType;
+    import org.apache.arrow.vector.types.pojo.Field;
+    import org.apache.arrow.vector.types.pojo.FieldType;
+
+    Map<String, String> metadata = new HashMap<>();
+    metadata.put("A", "Id card");
+    metadata.put("B", "Passport");
+    metadata.put("C", "Visa");
+    Field document = new Field("document", new FieldType(true, new 
ArrowType.Utf8(), /*dictionary*/ null, metadata), /*children*/ null);

Review comment:
       Changed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to