[ 
https://issues.apache.org/jira/browse/ORC-444?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16705595#comment-16705595
 ] 

ASF GitHub Bot commented on ORC-444:
------------------------------------

fangzheng commented on a change in pull request #345: ORC-444: Fix errors in 
RLE section in ORC spec and improve RLEV2 encoder code.
URL: https://github.com/apache/orc/pull/345#discussion_r238050318
 
 

 ##########
 File path: c++/src/RLEV2Util.cc
 ##########
 @@ -0,0 +1,29 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with option work for additional information
+ * regarding copyright ownership.  The ASF licenses option file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use option 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.
+ */
+
+#include "RLEV2Util.hh"
+
+namespace orc {
+
+  // Map FBS enum to bit width value.
+  const uint32_t FBSToBitWidthMap[FixedBitSizes::SIZE] = {
 
 Review comment:
   Hi Gang, 
   I checked this again and think the code is correct. Please see the mapping 
below:
   
   enum value  | int value | bitwidth
   ONE             | 0             | 1
   TWO            | 1              | 2
   ...
   TWENTYFOUR  | 23        | 24
   TWENTYSIX   | 24        | 26
   TWENTYEIGHT | 25        | 28
   THIRTY      | 26        | 30
   THIRTYTWO   | 27        | 32
   ...
   SIXTYFOUR   | 31        | 64
   
   So, for an enum value e that is n as an int, its bitwidth is indeed 
FBSToBitWidthMap[e]. For example, TWENTYFOUR is 23 as an int, and 
FBSToBitWidthMap[23] is 24. THIRTYTWO is 27 as an int, and FBSToBitWidthMap[27] 
is 32.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Fix errors in RLE section in ORC spec and improve RLEV2 encoder code.
> ---------------------------------------------------------------------
>
>                 Key: ORC-444
>                 URL: https://issues.apache.org/jira/browse/ORC-444
>             Project: ORC
>          Issue Type: Improvement
>          Components: C++, documentation
>            Reporter: Fang Zheng
>            Priority: Minor
>
> 1. Fixed a few typos and format errors in the RLE section in ORC 
> specification documentation.
> 2. Improve decodeBitWidth() function in RLEV2Util.hh.
> Please see PR for details.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to