wjones127 commented on code in PR #14200:
URL: https://github.com/apache/arrow/pull/14200#discussion_r979076496


##########
docs/source/cpp/gandiva.rst:
##########
@@ -0,0 +1,151 @@
+.. 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:: cpp
+.. highlight:: cpp
+.. cpp:namespace:: arrow::compute
+
+===============================
+The Gandiva Expression Compiler
+===============================
+
+Gandiva is a runtime expression compiler that uses `LLVM`_ to generate
+efficient native code for projections and filters on Arrow record batches.
+Gandiva only handles projections and filters. For other transformations, see
+:ref:`Compute Functions <compute-cpp>`.
+
+Gandiva was designed to take advantage of the Arrow memory format and modern
+hardware. Compiling expressions using LLVM allows the execution to be optimized
+to the local runtime environment and hardware, including available SIMD
+instructions. To reduce optimization overhead, many Gandiva functions are
+pre-compiled into LLVM IR (intermediate representation).
+
+.. _LLVM: https://llvm.org/
+
+
+Building Expressions
+====================
+
+Gandiva provides a general expression representation where expressions are
+represented by a tree of nodes. The expression trees are built using
+:class:`gandiva::TreeExprBuilder`. The leaves of the expression tree are 
typically
+field references, created by :func:`gandiva::TreeExprBuilder::MakeField`, and
+literal values, created by :func:`gandiva::TreeExprBuilder::MakeLiteral`. Nodes

Review Comment:
   > Are readers expected to know what a field or value would be, here?
   
   I think that's a reasonable assumption. These terms are pretty ubiquitous in 
the analytics engine space. (We have them in Acero, I've seen them in Spark 
before this.)
   
   Plus if it's not clear when first reading, the examples that come next 
should eliminate the ambiguity.
   
   > I can reason out that fields are variables, and literals are values, but 
it takes a bit of thinking
   
   Yeah in the world of SQL, for example, I think the idea of a "field" or 
"column" is actually very distinct from "variable". For example, "project these 
three fields from the data" or "select these columns from the table" might be 
common statements, but "select these variables from the table" isn't quite 
right.



-- 
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