GitHub user kevinjmh opened a pull request:
https://github.com/apache/carbondata/pull/2464
[CARBONDATA-2618][32K] Split to multiple pages if varchar column page
exceeds 2GB/snappy limits
Be sure to do all of the following checklist to help us incorporate
your contribution quickly and easily:
- [ ] Any interfaces changed?
- [ ] Any backward compatibility impacted?
- [ ] Document update required?
- [ ] Testing done
Please provide details on
- Whether new unit test cases have been added or why no new tests
are required?
- How it is tested? Please attach test report.
- Is it a performance related change? Please attach the performance
test report.
- Any additional information to help reviewers in testing this
change.
- [ ] For large changes, please consider breaking it into sub-tasks under
an umbrella JIRA.
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.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/kevinjmh/carbondata 32k_2gb
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/carbondata/pull/2464.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #2464
----
commit 4acd5a65489d228e926d6ff6222d5f24f52591f8
Author: Manhua <kevinjmh@...>
Date: 2018-07-09T08:42:08Z
dynamic column page size decided by long string column
----
---