ajantha-bhat commented on a change in pull request #2814: [CARBONDATA-3001] configurable page size in MB
URL: https://github.com/apache/carbondata/pull/2814#discussion_r273889773 ########## File path: processing/src/main/java/org/apache/carbondata/processing/store/CarbonFactDataHandlerColumnar.java ########## @@ -227,50 +260,135 @@ public void addDataToStore(CarbonRow row) throws CarbonDataWriterException { /** * Check if column page can be added more rows after adding this row to page. + * only few no-dictionary dimensions columns (string, varchar, + * complex columns) can grow huge in size. * - * A varchar column page uses SafeVarLengthColumnPage/UnsafeVarLengthColumnPage to store data - * and encoded using HighCardDictDimensionIndexCodec which will call getByteArrayPage() from - * column page and flatten into byte[] for compression. - * Limited by the index of array, we can only put number of Integer.MAX_VALUE bytes in a page. - * - * Another limitation is from Compressor. Currently we use snappy as default compressor, - * and it will call MaxCompressedLength method to estimate the result size for preparing output. - * For safety, the estimate result is oversize: `32 + source_len + source_len/6`. - * So the maximum bytes to compress by snappy is (2GB-32)*6/7≈1.71GB. - * - * Size of a row does not exceed 2MB since UnsafeSortDataRows uses 2MB byte[] as rowBuffer. - * Such that we can stop adding more row here if any long string column reach this limit. * - * If use unsafe column page, please ensure the memory configured is enough. - * @param row - * @return false if any varchar column page cannot add one more value(2MB) + * @param row carbonRow + * @return false if next rows can be added to same page. + * true if next rows cannot be added to same page */ - private boolean isVarcharColumnFull(CarbonRow row) { - //TODO: test and remove this as now UnsafeSortDataRows can exceed 2MB - if (model.getVarcharDimIdxInNoDict().size() > 0) { + private boolean needToCutThePage(CarbonRow row) { + List<DataType> noDictDataTypesList = model.getNoDictDataTypesList(); + int totalNoDictPageCount = noDictDataTypesList.size() + model.getNoDictAllComplexColumnDepth(); + if (totalNoDictPageCount > 0) { + int currentElementLength; + int bucketCounter = 0; + int configuredPageSizeInBytes; + String configuredPageSizeStrInBytes = + model.getTableSpec().getCarbonTable().getTableInfo().getFactTable().getTableProperties() + .get(CarbonCommonConstants.TABLE_PAGE_SIZE_INMB); Review comment: ok. done ---------------------------------------------------------------- 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: [hidden email] With regards, Apache Git Services |
Free forum by Nabble | Edit this page |