vvysotskyi commented on a change in pull request #2128:
URL: https://github.com/apache/drill/pull/2128#discussion_r544476918



##########
File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/store/bson/BsonRecordReader.java
##########
@@ -356,7 +358,25 @@ private void writeInt32(int readInt32, final 
MapOrListWriterImpl writer, String
     }
   }
 
-  public void ensureAtLeastOneField(ComplexWriter writer) {
+    private void writeDecimal128(BigDecimal readBigDecimal, final 
MapOrListWriterImpl writer, String fieldName, boolean isList) {
+        final VarDecimalHolder varDecimalHolder = new VarDecimalHolder();
+        byte[] bytes = readBigDecimal.unscaledValue().toByteArray();
+        ensure(bytes.length);
+        workBuf.setBytes(0, bytes);
+        varDecimalHolder.buffer = workBuf;
+        varDecimalHolder.scale = readBigDecimal.scale();
+        varDecimalHolder.precision = readBigDecimal.precision();
+        varDecimalHolder.start = 0;
+        varDecimalHolder.end =  bytes.length;
+        if (isList == false) {
+            writer.varDecimal(fieldName, varDecimalHolder.precision, 
varDecimalHolder.scale).write(varDecimalHolder);
+        } else {
+            writer.list.varDecimal().write(varDecimalHolder);
+        }

Review comment:
       You haven't removed the code where creating varDecimalHolder, it is not 
required for now.




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

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


Reply via email to