ARROW-6152: [C++][Parquet] Add parquet::ColumnWriter::WriteArrow method, refactor - #5036

Closed
wesm wants to merge 10 commits into
apache:masterfrom
wesm:ARROW-6152
Closed

ARROW-6152: [C++][Parquet] Add parquet::ColumnWriter::WriteArrow method, refactor #5036
wesm wants to merge 10 commits into
apache:masterfrom
wesm:ARROW-6152

Conversation

@wesm

@wesmwesm commented Aug 8, 2019

Copy link
Copy Markdown
Member
  • Write Arrow arrays directly to ColumnWriter, to allow internal optimizations and other features, like direct DictionaryArray writes
  • Refactor and streamline implementation for maintainability and readability
  • Move Arrow reader/writer properties to parquet/properties.h
  • Some minor miscellaneous code reorganization to help

Functionally the library is unchanged

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

cc @hatemhelal@xhochy

@hatemhelalhatemhelal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, looks good to me.

Comment threadcpp/src/parquet/properties.h Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't tell without compiling but I wondered if this could be done in the member initializer list:

 ArrowWriteContext(MemoryPool* memory_pool, ArrowWriterProperties* properties)
: memory_pool(memory_pool), properties(properties), data_buffer(AllocateBuffer(memory_pool)),
def_levels_buffer(AllocateBuffer(memory_pool)) { }

This might fall in the category of a micro (or even nano) optimization.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll make this change

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

@romainfrancois@nealrichardson I've noted that when I run R CMD INSTALL . that when the R extension is tested, system library paths are given precedence over the contents of $LD_LIBRARY_PATH. This is very annoying for me because there is an older version of liblz4 in Ubuntu 18.04's system paths that is incompatible with the one that we use in libarrow.so. Do you know any way to fix this? I can also open a JIRA issue

@nealrichardson

Copy link
Copy Markdown
Member

@wesm can you provide a traceback/console output of what the failure looks like/where it happens?

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor
$ R CMD INSTALL .
* installing to library ‘/home/wesm/R/x86_64-pc-linux-gnu-library/3.6’
* installing *source* package ‘arrow’ ...
** using staged installation
Arrow C++ libraries found via pkg-config
PKG_CFLAGS=-I/home/wesm/local/include -DARROW_R_WITH_ARROW
PKG_LIBS=-L/home/wesm/local/lib -larrow -lparquet
** libs
make: Nothing to be done for 'all'.
installing to /home/wesm/R/x86_64-pc-linux-gnu-library/3.6/00LOCK-r/00new/arrow/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘arrow’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/wesm/R/x86_64-pc-linux-gnu-library/3.6/00LOCK-r/00new/arrow/libs/arrow.so':
/home/wesm/local/lib/libarrow.so.100: undefined symbol: LZ4F_resetDecompressionContext
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/wesm/R/x86_64-pc-linux-gnu-library/3.6/arrow’
* restoring previous ‘/home/wesm/R/x86_64-pc-linux-gnu-library/3.6/arrow’

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

And of course

$ ldd ~/local/lib/libarrow.so
linux-vdso.so.1 (0x00007ffd2bcfc000)
libcrypto.so.1.1 => /home/wesm/cpp-runtime-toolchain/lib/libcrypto.so.1.1 (0x00007fce910f2000)
libssl.so.1.1 => /home/wesm/cpp-runtime-toolchain/lib/libssl.so.1.1 (0x00007fce92fe4000)
libglog.so.0 => /home/wesm/cpp-runtime-toolchain/lib/libglog.so.0 (0x00007fce92fab000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fce90eee000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fce90ce6000)
libbz2.so.1.0 => /home/wesm/cpp-runtime-toolchain/lib/libbz2.so.1.0 (0x00007fce92f73000)
liblz4.so.1 => /home/wesm/cpp-runtime-toolchain/lib/liblz4.so.1 (0x00007fce92f3b000)
libsnappy.so.1 => /home/wesm/cpp-runtime-toolchain/lib/libsnappy.so.1 (0x00007fce92f30000)
libz.so.1 => /home/wesm/cpp-runtime-toolchain/lib/libz.so.1 (0x00007fce92f16000)
libzstd.so.1 => /home/wesm/cpp-runtime-toolchain/lib/libzstd.so.1 (0x00007fce90a49000)
libboost_system.so.1.70.0 => /home/wesm/cpp-runtime-toolchain/lib/libboost_system.so.1.70.0 (0x00007fce92f11000)
libboost_filesystem.so.1.70.0 => /home/wesm/cpp-runtime-toolchain/lib/libboost_filesystem.so.1.70.0 (0x00007fce92eef000)
libstdc++.so.6 => /home/wesm/cpp-runtime-toolchain/lib/libstdc++.so.6 (0x00007fce908d5000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fce90537000)
libgcc_s.so.1 => /home/wesm/cpp-runtime-toolchain/lib/libgcc_s.so.1 (0x00007fce92edb000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fce90318000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fce8ff27000)
/lib64/ld-linux-x86-64.so.2 (0x00007fce92e4f000)
libgflags.so.2.2 => /home/wesm/cpp-runtime-toolchain/lib/./libgflags.so.2.2 (0x00007fce92eb5000)

So outside of the context of R CMD INSTALL the correct liblz4.so is resolved

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

+1, will merge this PR once Travis CI runs...

@nealrichardson

Copy link
Copy Markdown
Member

One thing you can check out is what is in $(R RHOME)/etc/ldpaths. I saw that referenced in The Bible. Maybe you can amend that and it will pick up the right path? Or make it pay attention to the LD_LIBRARY_PATH you set? Totally guessing though, this is not my area of expertise.

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

Ugh

$ cat /etc/R/ldpaths : ${JAVA_HOME=/usr/lib/jvm/default-java}
: ${R_JAVA_LD_LIBRARY_PATH=${JAVA_HOME}/lib/server}
if test -n "/usr/lib/x86_64-linux-gnu"; then
: ${R_LD_LIBRARY_PATH=${R_HOME}/lib:/usr/lib/x86_64-linux-gnu}
else
: ${R_LD_LIBRARY_PATH=${R_HOME}/lib}
fi
if test -n "${R_JAVA_LD_LIBRARY_PATH}"; then
R_LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}:${R_JAVA_LD_LIBRARY_PATH}"
fi
## This is DYLD_FALLBACK_LIBRARY_PATH on Darwin (macOS) and
## LD_LIBRARY_PATH elsewhere.
## However, on macOS >=10.11 (if SIP is enabled, the default), the
## environment value will not be passed to a script such as R.sh, so
## would not seen here.
if test -z "${LD_LIBRARY_PATH}"; then
LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}"
else
LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}"
fi
export LD_LIBRARY_PATH

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

IMHO this is a bug in R. If you have $LD_LIBRARY_PATH set it should respect that

@nealrichardson

Copy link
Copy Markdown
Member

OIC, it puts its path before the one you provide. That's odd. If you reverse the order of the paths in that next to last line, does it work as expected?

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

This works fine

$ R_LD_LIBRARY_PATH=$LD_LIBRARY_PATH R CMD INSTALL .
* installing to library ‘/home/wesm/R/x86_64-pc-linux-gnu-library/3.6’
* installing *source* package ‘arrow’ ...
** using staged installation
Arrow C++ libraries found via pkg-config
PKG_CFLAGS=-I/home/wesm/local/include -DARROW_R_WITH_ARROW
PKG_LIBS=-L/home/wesm/local/lib -larrow -lparquet
** libs
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/home/wesm/local/include -DARROW_R_WITH_ARROW -I"/home/wesm/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include" -fvisibility=hidden -fpic -g -O2 -fdebug-prefix-map=/build/r-base-uuRxut/r-base-3.6.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c arrowExports.cpp -o arrowExports.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/home/wesm/local/include -DARROW_R_WITH_ARROW -I"/home/wesm/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include" -fvisibility=hidden -fpic -g -O2 -fdebug-prefix-map=/build/r-base-uuRxut/r-base-3.6.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c parquet.cpp -o parquet.o
g++ -std=gnu++11 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o arrow.so array.o array__to_vector.o array_from_vector.o arraydata.o arrowExports.o buffer.o chunkedarray.o compression.o compute.o csv.o datatype.o feather.o field.o io.o json.o memorypool.o message.o parquet.o recordbatch.o recordbatchreader.o recordbatchwriter.o schema.o symbols.o table.o threadpool.o -L/home/wesm/local/lib -larrow -lparquet -L/usr/lib/R/lib -lR
installing to /home/wesm/R/x86_64-pc-linux-gnu-library/3.6/00LOCK-r/00new/arrow/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (arrow)

I'll do that as a workaround. We should document it for developers

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

I guess I can kind of understand the point of view of wanting to isolate R from being contaminated by the user's environment, including modifications of LD_LIBRARY_PATH. Since if you build a package when LD_LIBRARY_PATH set and then unset it, that package could be broken

@codecov-io

Copy link
Copy Markdown

Codecov Report

Merging #5036 into master will increase coverage by 1.59%.
The diff coverage is 94.25%.

Impacted file tree graph

@@ Coverage Diff @@## master #5036 +/- ##
==========================================
+ Coverage 87.57% 89.17% +1.59% 
==========================================
Files 1008 727 -281 Lines 143814 102958 -40856 Branches 1418 0 -1418 ==========================================
- Hits 125952 91814 -34138 + Misses 17500 11144 -6356 + Partials 362 0 -362
Impacted FilesCoverage Δ
cpp/src/parquet/arrow/reader_internal.cc91.27% <ø> (ø)⬆️
cpp/src/parquet/arrow/reader_internal.h93.02% <ø> (ø)⬆️
cpp/src/parquet/arrow/reader.h80% <ø> (-12.31%)⬇️
cpp/src/parquet/schema.cc90.01% <ø> (ø)⬆️
cpp/src/parquet/arrow/writer.h100% <ø> (ø)⬆️
cpp/src/parquet/types.h100% <ø> (ø)⬆️
cpp/src/parquet/arrow/reader.cc84.86% <ø> (-0.13%)⬇️
cpp/src/parquet/column_writer.h95.65% <100%> (+6.76%)⬆️
cpp/src/parquet/arrow/arrow-reader-writer-test.cc93.73% <100%> (ø)⬆️
cpp/src/parquet/properties.cc73.33% <100%> (+17.77%)⬆️
... and 290 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d549b7c...b2ddcb3. Read the comment docs.

@wesmwesm closed this in b4c1763Aug 9, 2019
@wesm
wesm deleted the ARROW-6152 branch August 9, 2019 01:23
@nealrichardson

Copy link
Copy Markdown
Member

If it's a bug, it's been around a while. I traced it back to a commit from the end of the Clinton presidency: wch/r-source@b4f9299

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@wesm@nealrichardson@codecov-io@hatemhelal
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

ARROW-6152: [C++][Parquet] Add parquet::ColumnWriter::WriteArrow method, refactor - #5036

Closed
wesm wants to merge 10 commits into
apache:masterfrom
wesm:ARROW-6152
Closed

ARROW-6152: [C++][Parquet] Add parquet::ColumnWriter::WriteArrow method, refactor #5036
wesm wants to merge 10 commits into
apache:masterfrom
wesm:ARROW-6152

Conversation

@wesm

@wesmwesm commented Aug 8, 2019

Copy link
Copy Markdown
Member
  • Write Arrow arrays directly to ColumnWriter, to allow internal optimizations and other features, like direct DictionaryArray writes
  • Refactor and streamline implementation for maintainability and readability
  • Move Arrow reader/writer properties to parquet/properties.h
  • Some minor miscellaneous code reorganization to help

Functionally the library is unchanged

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

cc @hatemhelal@xhochy

@hatemhelalhatemhelal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, looks good to me.

Comment threadcpp/src/parquet/properties.h Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't tell without compiling but I wondered if this could be done in the member initializer list:

 ArrowWriteContext(MemoryPool* memory_pool, ArrowWriterProperties* properties)
: memory_pool(memory_pool), properties(properties), data_buffer(AllocateBuffer(memory_pool)),
def_levels_buffer(AllocateBuffer(memory_pool)) { }

This might fall in the category of a micro (or even nano) optimization.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll make this change

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

@romainfrancois@nealrichardson I've noted that when I run R CMD INSTALL . that when the R extension is tested, system library paths are given precedence over the contents of $LD_LIBRARY_PATH. This is very annoying for me because there is an older version of liblz4 in Ubuntu 18.04's system paths that is incompatible with the one that we use in libarrow.so. Do you know any way to fix this? I can also open a JIRA issue

@nealrichardson

Copy link
Copy Markdown
Member

@wesm can you provide a traceback/console output of what the failure looks like/where it happens?

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor
$ R CMD INSTALL .
* installing to library ‘/home/wesm/R/x86_64-pc-linux-gnu-library/3.6’
* installing *source* package ‘arrow’ ...
** using staged installation
Arrow C++ libraries found via pkg-config
PKG_CFLAGS=-I/home/wesm/local/include -DARROW_R_WITH_ARROW
PKG_LIBS=-L/home/wesm/local/lib -larrow -lparquet
** libs
make: Nothing to be done for 'all'.
installing to /home/wesm/R/x86_64-pc-linux-gnu-library/3.6/00LOCK-r/00new/arrow/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘arrow’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/wesm/R/x86_64-pc-linux-gnu-library/3.6/00LOCK-r/00new/arrow/libs/arrow.so':
/home/wesm/local/lib/libarrow.so.100: undefined symbol: LZ4F_resetDecompressionContext
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/wesm/R/x86_64-pc-linux-gnu-library/3.6/arrow’
* restoring previous ‘/home/wesm/R/x86_64-pc-linux-gnu-library/3.6/arrow’

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

And of course

$ ldd ~/local/lib/libarrow.so
linux-vdso.so.1 (0x00007ffd2bcfc000)
libcrypto.so.1.1 => /home/wesm/cpp-runtime-toolchain/lib/libcrypto.so.1.1 (0x00007fce910f2000)
libssl.so.1.1 => /home/wesm/cpp-runtime-toolchain/lib/libssl.so.1.1 (0x00007fce92fe4000)
libglog.so.0 => /home/wesm/cpp-runtime-toolchain/lib/libglog.so.0 (0x00007fce92fab000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fce90eee000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fce90ce6000)
libbz2.so.1.0 => /home/wesm/cpp-runtime-toolchain/lib/libbz2.so.1.0 (0x00007fce92f73000)
liblz4.so.1 => /home/wesm/cpp-runtime-toolchain/lib/liblz4.so.1 (0x00007fce92f3b000)
libsnappy.so.1 => /home/wesm/cpp-runtime-toolchain/lib/libsnappy.so.1 (0x00007fce92f30000)
libz.so.1 => /home/wesm/cpp-runtime-toolchain/lib/libz.so.1 (0x00007fce92f16000)
libzstd.so.1 => /home/wesm/cpp-runtime-toolchain/lib/libzstd.so.1 (0x00007fce90a49000)
libboost_system.so.1.70.0 => /home/wesm/cpp-runtime-toolchain/lib/libboost_system.so.1.70.0 (0x00007fce92f11000)
libboost_filesystem.so.1.70.0 => /home/wesm/cpp-runtime-toolchain/lib/libboost_filesystem.so.1.70.0 (0x00007fce92eef000)
libstdc++.so.6 => /home/wesm/cpp-runtime-toolchain/lib/libstdc++.so.6 (0x00007fce908d5000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fce90537000)
libgcc_s.so.1 => /home/wesm/cpp-runtime-toolchain/lib/libgcc_s.so.1 (0x00007fce92edb000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fce90318000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fce8ff27000)
/lib64/ld-linux-x86-64.so.2 (0x00007fce92e4f000)
libgflags.so.2.2 => /home/wesm/cpp-runtime-toolchain/lib/./libgflags.so.2.2 (0x00007fce92eb5000)

So outside of the context of R CMD INSTALL the correct liblz4.so is resolved

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

+1, will merge this PR once Travis CI runs...

@nealrichardson

Copy link
Copy Markdown
Member

One thing you can check out is what is in $(R RHOME)/etc/ldpaths. I saw that referenced in The Bible. Maybe you can amend that and it will pick up the right path? Or make it pay attention to the LD_LIBRARY_PATH you set? Totally guessing though, this is not my area of expertise.

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

Ugh

$ cat /etc/R/ldpaths : ${JAVA_HOME=/usr/lib/jvm/default-java}
: ${R_JAVA_LD_LIBRARY_PATH=${JAVA_HOME}/lib/server}
if test -n "/usr/lib/x86_64-linux-gnu"; then
: ${R_LD_LIBRARY_PATH=${R_HOME}/lib:/usr/lib/x86_64-linux-gnu}
else
: ${R_LD_LIBRARY_PATH=${R_HOME}/lib}
fi
if test -n "${R_JAVA_LD_LIBRARY_PATH}"; then
R_LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}:${R_JAVA_LD_LIBRARY_PATH}"
fi
## This is DYLD_FALLBACK_LIBRARY_PATH on Darwin (macOS) and
## LD_LIBRARY_PATH elsewhere.
## However, on macOS >=10.11 (if SIP is enabled, the default), the
## environment value will not be passed to a script such as R.sh, so
## would not seen here.
if test -z "${LD_LIBRARY_PATH}"; then
LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}"
else
LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}"
fi
export LD_LIBRARY_PATH

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

IMHO this is a bug in R. If you have $LD_LIBRARY_PATH set it should respect that

@nealrichardson

Copy link
Copy Markdown
Member

OIC, it puts its path before the one you provide. That's odd. If you reverse the order of the paths in that next to last line, does it work as expected?

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

This works fine

$ R_LD_LIBRARY_PATH=$LD_LIBRARY_PATH R CMD INSTALL .
* installing to library ‘/home/wesm/R/x86_64-pc-linux-gnu-library/3.6’
* installing *source* package ‘arrow’ ...
** using staged installation
Arrow C++ libraries found via pkg-config
PKG_CFLAGS=-I/home/wesm/local/include -DARROW_R_WITH_ARROW
PKG_LIBS=-L/home/wesm/local/lib -larrow -lparquet
** libs
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/home/wesm/local/include -DARROW_R_WITH_ARROW -I"/home/wesm/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include" -fvisibility=hidden -fpic -g -O2 -fdebug-prefix-map=/build/r-base-uuRxut/r-base-3.6.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c arrowExports.cpp -o arrowExports.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/home/wesm/local/include -DARROW_R_WITH_ARROW -I"/home/wesm/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include" -fvisibility=hidden -fpic -g -O2 -fdebug-prefix-map=/build/r-base-uuRxut/r-base-3.6.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c parquet.cpp -o parquet.o
g++ -std=gnu++11 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o arrow.so array.o array__to_vector.o array_from_vector.o arraydata.o arrowExports.o buffer.o chunkedarray.o compression.o compute.o csv.o datatype.o feather.o field.o io.o json.o memorypool.o message.o parquet.o recordbatch.o recordbatchreader.o recordbatchwriter.o schema.o symbols.o table.o threadpool.o -L/home/wesm/local/lib -larrow -lparquet -L/usr/lib/R/lib -lR
installing to /home/wesm/R/x86_64-pc-linux-gnu-library/3.6/00LOCK-r/00new/arrow/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (arrow)

I'll do that as a workaround. We should document it for developers

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

I guess I can kind of understand the point of view of wanting to isolate R from being contaminated by the user's environment, including modifications of LD_LIBRARY_PATH. Since if you build a package when LD_LIBRARY_PATH set and then unset it, that package could be broken

@codecov-io

Copy link
Copy Markdown

Codecov Report

Merging #5036 into master will increase coverage by 1.59%.
The diff coverage is 94.25%.

Impacted file tree graph

@@ Coverage Diff @@## master #5036 +/- ##
==========================================
+ Coverage 87.57% 89.17% +1.59% 
==========================================
Files 1008 727 -281 Lines 143814 102958 -40856 Branches 1418 0 -1418 ==========================================
- Hits 125952 91814 -34138 + Misses 17500 11144 -6356 + Partials 362 0 -362
Impacted FilesCoverage Δ
cpp/src/parquet/arrow/reader_internal.cc91.27% <ø> (ø)⬆️
cpp/src/parquet/arrow/reader_internal.h93.02% <ø> (ø)⬆️
cpp/src/parquet/arrow/reader.h80% <ø> (-12.31%)⬇️
cpp/src/parquet/schema.cc90.01% <ø> (ø)⬆️
cpp/src/parquet/arrow/writer.h100% <ø> (ø)⬆️
cpp/src/parquet/types.h100% <ø> (ø)⬆️
cpp/src/parquet/arrow/reader.cc84.86% <ø> (-0.13%)⬇️
cpp/src/parquet/column_writer.h95.65% <100%> (+6.76%)⬆️
cpp/src/parquet/arrow/arrow-reader-writer-test.cc93.73% <100%> (ø)⬆️
cpp/src/parquet/properties.cc73.33% <100%> (+17.77%)⬆️
... and 290 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d549b7c...b2ddcb3. Read the comment docs.

@wesmwesm closed this in b4c1763Aug 9, 2019
@wesm
wesm deleted the ARROW-6152 branch August 9, 2019 01:23
@nealrichardson

Copy link
Copy Markdown
Member

If it's a bug, it's been around a while. I traced it back to a commit from the end of the Clinton presidency: wch/r-source@b4f9299

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@wesm@nealrichardson@codecov-io@hatemhelal
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

ARROW-6152: [C++][Parquet] Add parquet::ColumnWriter::WriteArrow method, refactor - #5036

Closed
wesm wants to merge 10 commits into
apache:masterfrom
wesm:ARROW-6152
Closed

ARROW-6152: [C++][Parquet] Add parquet::ColumnWriter::WriteArrow method, refactor #5036
wesm wants to merge 10 commits into
apache:masterfrom
wesm:ARROW-6152

Conversation

@wesm

@wesmwesm commented Aug 8, 2019

Copy link
Copy Markdown
Member
  • Write Arrow arrays directly to ColumnWriter, to allow internal optimizations and other features, like direct DictionaryArray writes
  • Refactor and streamline implementation for maintainability and readability
  • Move Arrow reader/writer properties to parquet/properties.h
  • Some minor miscellaneous code reorganization to help

Functionally the library is unchanged

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

cc @hatemhelal@xhochy

@hatemhelalhatemhelal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, looks good to me.

Comment threadcpp/src/parquet/properties.h Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't tell without compiling but I wondered if this could be done in the member initializer list:

 ArrowWriteContext(MemoryPool* memory_pool, ArrowWriterProperties* properties)
: memory_pool(memory_pool), properties(properties), data_buffer(AllocateBuffer(memory_pool)),
def_levels_buffer(AllocateBuffer(memory_pool)) { }

This might fall in the category of a micro (or even nano) optimization.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll make this change

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

@romainfrancois@nealrichardson I've noted that when I run R CMD INSTALL . that when the R extension is tested, system library paths are given precedence over the contents of $LD_LIBRARY_PATH. This is very annoying for me because there is an older version of liblz4 in Ubuntu 18.04's system paths that is incompatible with the one that we use in libarrow.so. Do you know any way to fix this? I can also open a JIRA issue

@nealrichardson

Copy link
Copy Markdown
Member

@wesm can you provide a traceback/console output of what the failure looks like/where it happens?

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor
$ R CMD INSTALL .
* installing to library ‘/home/wesm/R/x86_64-pc-linux-gnu-library/3.6’
* installing *source* package ‘arrow’ ...
** using staged installation
Arrow C++ libraries found via pkg-config
PKG_CFLAGS=-I/home/wesm/local/include -DARROW_R_WITH_ARROW
PKG_LIBS=-L/home/wesm/local/lib -larrow -lparquet
** libs
make: Nothing to be done for 'all'.
installing to /home/wesm/R/x86_64-pc-linux-gnu-library/3.6/00LOCK-r/00new/arrow/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘arrow’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/wesm/R/x86_64-pc-linux-gnu-library/3.6/00LOCK-r/00new/arrow/libs/arrow.so':
/home/wesm/local/lib/libarrow.so.100: undefined symbol: LZ4F_resetDecompressionContext
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/wesm/R/x86_64-pc-linux-gnu-library/3.6/arrow’
* restoring previous ‘/home/wesm/R/x86_64-pc-linux-gnu-library/3.6/arrow’

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

And of course

$ ldd ~/local/lib/libarrow.so
linux-vdso.so.1 (0x00007ffd2bcfc000)
libcrypto.so.1.1 => /home/wesm/cpp-runtime-toolchain/lib/libcrypto.so.1.1 (0x00007fce910f2000)
libssl.so.1.1 => /home/wesm/cpp-runtime-toolchain/lib/libssl.so.1.1 (0x00007fce92fe4000)
libglog.so.0 => /home/wesm/cpp-runtime-toolchain/lib/libglog.so.0 (0x00007fce92fab000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fce90eee000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fce90ce6000)
libbz2.so.1.0 => /home/wesm/cpp-runtime-toolchain/lib/libbz2.so.1.0 (0x00007fce92f73000)
liblz4.so.1 => /home/wesm/cpp-runtime-toolchain/lib/liblz4.so.1 (0x00007fce92f3b000)
libsnappy.so.1 => /home/wesm/cpp-runtime-toolchain/lib/libsnappy.so.1 (0x00007fce92f30000)
libz.so.1 => /home/wesm/cpp-runtime-toolchain/lib/libz.so.1 (0x00007fce92f16000)
libzstd.so.1 => /home/wesm/cpp-runtime-toolchain/lib/libzstd.so.1 (0x00007fce90a49000)
libboost_system.so.1.70.0 => /home/wesm/cpp-runtime-toolchain/lib/libboost_system.so.1.70.0 (0x00007fce92f11000)
libboost_filesystem.so.1.70.0 => /home/wesm/cpp-runtime-toolchain/lib/libboost_filesystem.so.1.70.0 (0x00007fce92eef000)
libstdc++.so.6 => /home/wesm/cpp-runtime-toolchain/lib/libstdc++.so.6 (0x00007fce908d5000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fce90537000)
libgcc_s.so.1 => /home/wesm/cpp-runtime-toolchain/lib/libgcc_s.so.1 (0x00007fce92edb000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fce90318000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fce8ff27000)
/lib64/ld-linux-x86-64.so.2 (0x00007fce92e4f000)
libgflags.so.2.2 => /home/wesm/cpp-runtime-toolchain/lib/./libgflags.so.2.2 (0x00007fce92eb5000)

So outside of the context of R CMD INSTALL the correct liblz4.so is resolved

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

+1, will merge this PR once Travis CI runs...

@nealrichardson

Copy link
Copy Markdown
Member

One thing you can check out is what is in $(R RHOME)/etc/ldpaths. I saw that referenced in The Bible. Maybe you can amend that and it will pick up the right path? Or make it pay attention to the LD_LIBRARY_PATH you set? Totally guessing though, this is not my area of expertise.

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

Ugh

$ cat /etc/R/ldpaths : ${JAVA_HOME=/usr/lib/jvm/default-java}
: ${R_JAVA_LD_LIBRARY_PATH=${JAVA_HOME}/lib/server}
if test -n "/usr/lib/x86_64-linux-gnu"; then
: ${R_LD_LIBRARY_PATH=${R_HOME}/lib:/usr/lib/x86_64-linux-gnu}
else
: ${R_LD_LIBRARY_PATH=${R_HOME}/lib}
fi
if test -n "${R_JAVA_LD_LIBRARY_PATH}"; then
R_LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}:${R_JAVA_LD_LIBRARY_PATH}"
fi
## This is DYLD_FALLBACK_LIBRARY_PATH on Darwin (macOS) and
## LD_LIBRARY_PATH elsewhere.
## However, on macOS >=10.11 (if SIP is enabled, the default), the
## environment value will not be passed to a script such as R.sh, so
## would not seen here.
if test -z "${LD_LIBRARY_PATH}"; then
LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}"
else
LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}"
fi
export LD_LIBRARY_PATH

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

IMHO this is a bug in R. If you have $LD_LIBRARY_PATH set it should respect that

@nealrichardson

Copy link
Copy Markdown
Member

OIC, it puts its path before the one you provide. That's odd. If you reverse the order of the paths in that next to last line, does it work as expected?

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

This works fine

$ R_LD_LIBRARY_PATH=$LD_LIBRARY_PATH R CMD INSTALL .
* installing to library ‘/home/wesm/R/x86_64-pc-linux-gnu-library/3.6’
* installing *source* package ‘arrow’ ...
** using staged installation
Arrow C++ libraries found via pkg-config
PKG_CFLAGS=-I/home/wesm/local/include -DARROW_R_WITH_ARROW
PKG_LIBS=-L/home/wesm/local/lib -larrow -lparquet
** libs
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/home/wesm/local/include -DARROW_R_WITH_ARROW -I"/home/wesm/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include" -fvisibility=hidden -fpic -g -O2 -fdebug-prefix-map=/build/r-base-uuRxut/r-base-3.6.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c arrowExports.cpp -o arrowExports.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/home/wesm/local/include -DARROW_R_WITH_ARROW -I"/home/wesm/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include" -fvisibility=hidden -fpic -g -O2 -fdebug-prefix-map=/build/r-base-uuRxut/r-base-3.6.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c parquet.cpp -o parquet.o
g++ -std=gnu++11 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o arrow.so array.o array__to_vector.o array_from_vector.o arraydata.o arrowExports.o buffer.o chunkedarray.o compression.o compute.o csv.o datatype.o feather.o field.o io.o json.o memorypool.o message.o parquet.o recordbatch.o recordbatchreader.o recordbatchwriter.o schema.o symbols.o table.o threadpool.o -L/home/wesm/local/lib -larrow -lparquet -L/usr/lib/R/lib -lR
installing to /home/wesm/R/x86_64-pc-linux-gnu-library/3.6/00LOCK-r/00new/arrow/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (arrow)

I'll do that as a workaround. We should document it for developers

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

I guess I can kind of understand the point of view of wanting to isolate R from being contaminated by the user's environment, including modifications of LD_LIBRARY_PATH. Since if you build a package when LD_LIBRARY_PATH set and then unset it, that package could be broken

@codecov-io

Copy link
Copy Markdown

Codecov Report

Merging #5036 into master will increase coverage by 1.59%.
The diff coverage is 94.25%.

Impacted file tree graph

@@ Coverage Diff @@## master #5036 +/- ##
==========================================
+ Coverage 87.57% 89.17% +1.59% 
==========================================
Files 1008 727 -281 Lines 143814 102958 -40856 Branches 1418 0 -1418 ==========================================
- Hits 125952 91814 -34138 + Misses 17500 11144 -6356 + Partials 362 0 -362
Impacted FilesCoverage Δ
cpp/src/parquet/arrow/reader_internal.cc91.27% <ø> (ø)⬆️
cpp/src/parquet/arrow/reader_internal.h93.02% <ø> (ø)⬆️
cpp/src/parquet/arrow/reader.h80% <ø> (-12.31%)⬇️
cpp/src/parquet/schema.cc90.01% <ø> (ø)⬆️
cpp/src/parquet/arrow/writer.h100% <ø> (ø)⬆️
cpp/src/parquet/types.h100% <ø> (ø)⬆️
cpp/src/parquet/arrow/reader.cc84.86% <ø> (-0.13%)⬇️
cpp/src/parquet/column_writer.h95.65% <100%> (+6.76%)⬆️
cpp/src/parquet/arrow/arrow-reader-writer-test.cc93.73% <100%> (ø)⬆️
cpp/src/parquet/properties.cc73.33% <100%> (+17.77%)⬆️
... and 290 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d549b7c...b2ddcb3. Read the comment docs.

@wesmwesm closed this in b4c1763Aug 9, 2019
@wesm
wesm deleted the ARROW-6152 branch August 9, 2019 01:23
@nealrichardson

Copy link
Copy Markdown
Member

If it's a bug, it's been around a while. I traced it back to a commit from the end of the Clinton presidency: wch/r-source@b4f9299

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@wesm@nealrichardson@codecov-io@hatemhelal
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

ARROW-6152: [C++][Parquet] Add parquet::ColumnWriter::WriteArrow method, refactor - #5036

Closed
wesm wants to merge 10 commits into
apache:masterfrom
wesm:ARROW-6152
Closed

ARROW-6152: [C++][Parquet] Add parquet::ColumnWriter::WriteArrow method, refactor #5036
wesm wants to merge 10 commits into
apache:masterfrom
wesm:ARROW-6152

Conversation

@wesm

@wesmwesm commented Aug 8, 2019

Copy link
Copy Markdown
Member
  • Write Arrow arrays directly to ColumnWriter, to allow internal optimizations and other features, like direct DictionaryArray writes
  • Refactor and streamline implementation for maintainability and readability
  • Move Arrow reader/writer properties to parquet/properties.h
  • Some minor miscellaneous code reorganization to help

Functionally the library is unchanged

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

cc @hatemhelal@xhochy

@hatemhelalhatemhelal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, looks good to me.

Comment threadcpp/src/parquet/properties.h Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't tell without compiling but I wondered if this could be done in the member initializer list:

 ArrowWriteContext(MemoryPool* memory_pool, ArrowWriterProperties* properties)
: memory_pool(memory_pool), properties(properties), data_buffer(AllocateBuffer(memory_pool)),
def_levels_buffer(AllocateBuffer(memory_pool)) { }

This might fall in the category of a micro (or even nano) optimization.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll make this change

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

@romainfrancois@nealrichardson I've noted that when I run R CMD INSTALL . that when the R extension is tested, system library paths are given precedence over the contents of $LD_LIBRARY_PATH. This is very annoying for me because there is an older version of liblz4 in Ubuntu 18.04's system paths that is incompatible with the one that we use in libarrow.so. Do you know any way to fix this? I can also open a JIRA issue

@nealrichardson

Copy link
Copy Markdown
Member

@wesm can you provide a traceback/console output of what the failure looks like/where it happens?

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor
$ R CMD INSTALL .
* installing to library ‘/home/wesm/R/x86_64-pc-linux-gnu-library/3.6’
* installing *source* package ‘arrow’ ...
** using staged installation
Arrow C++ libraries found via pkg-config
PKG_CFLAGS=-I/home/wesm/local/include -DARROW_R_WITH_ARROW
PKG_LIBS=-L/home/wesm/local/lib -larrow -lparquet
** libs
make: Nothing to be done for 'all'.
installing to /home/wesm/R/x86_64-pc-linux-gnu-library/3.6/00LOCK-r/00new/arrow/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘arrow’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/wesm/R/x86_64-pc-linux-gnu-library/3.6/00LOCK-r/00new/arrow/libs/arrow.so':
/home/wesm/local/lib/libarrow.so.100: undefined symbol: LZ4F_resetDecompressionContext
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/wesm/R/x86_64-pc-linux-gnu-library/3.6/arrow’
* restoring previous ‘/home/wesm/R/x86_64-pc-linux-gnu-library/3.6/arrow’

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

And of course

$ ldd ~/local/lib/libarrow.so
linux-vdso.so.1 (0x00007ffd2bcfc000)
libcrypto.so.1.1 => /home/wesm/cpp-runtime-toolchain/lib/libcrypto.so.1.1 (0x00007fce910f2000)
libssl.so.1.1 => /home/wesm/cpp-runtime-toolchain/lib/libssl.so.1.1 (0x00007fce92fe4000)
libglog.so.0 => /home/wesm/cpp-runtime-toolchain/lib/libglog.so.0 (0x00007fce92fab000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fce90eee000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fce90ce6000)
libbz2.so.1.0 => /home/wesm/cpp-runtime-toolchain/lib/libbz2.so.1.0 (0x00007fce92f73000)
liblz4.so.1 => /home/wesm/cpp-runtime-toolchain/lib/liblz4.so.1 (0x00007fce92f3b000)
libsnappy.so.1 => /home/wesm/cpp-runtime-toolchain/lib/libsnappy.so.1 (0x00007fce92f30000)
libz.so.1 => /home/wesm/cpp-runtime-toolchain/lib/libz.so.1 (0x00007fce92f16000)
libzstd.so.1 => /home/wesm/cpp-runtime-toolchain/lib/libzstd.so.1 (0x00007fce90a49000)
libboost_system.so.1.70.0 => /home/wesm/cpp-runtime-toolchain/lib/libboost_system.so.1.70.0 (0x00007fce92f11000)
libboost_filesystem.so.1.70.0 => /home/wesm/cpp-runtime-toolchain/lib/libboost_filesystem.so.1.70.0 (0x00007fce92eef000)
libstdc++.so.6 => /home/wesm/cpp-runtime-toolchain/lib/libstdc++.so.6 (0x00007fce908d5000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fce90537000)
libgcc_s.so.1 => /home/wesm/cpp-runtime-toolchain/lib/libgcc_s.so.1 (0x00007fce92edb000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fce90318000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fce8ff27000)
/lib64/ld-linux-x86-64.so.2 (0x00007fce92e4f000)
libgflags.so.2.2 => /home/wesm/cpp-runtime-toolchain/lib/./libgflags.so.2.2 (0x00007fce92eb5000)

So outside of the context of R CMD INSTALL the correct liblz4.so is resolved

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

+1, will merge this PR once Travis CI runs...

@nealrichardson

Copy link
Copy Markdown
Member

One thing you can check out is what is in $(R RHOME)/etc/ldpaths. I saw that referenced in The Bible. Maybe you can amend that and it will pick up the right path? Or make it pay attention to the LD_LIBRARY_PATH you set? Totally guessing though, this is not my area of expertise.

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

Ugh

$ cat /etc/R/ldpaths : ${JAVA_HOME=/usr/lib/jvm/default-java}
: ${R_JAVA_LD_LIBRARY_PATH=${JAVA_HOME}/lib/server}
if test -n "/usr/lib/x86_64-linux-gnu"; then
: ${R_LD_LIBRARY_PATH=${R_HOME}/lib:/usr/lib/x86_64-linux-gnu}
else
: ${R_LD_LIBRARY_PATH=${R_HOME}/lib}
fi
if test -n "${R_JAVA_LD_LIBRARY_PATH}"; then
R_LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}:${R_JAVA_LD_LIBRARY_PATH}"
fi
## This is DYLD_FALLBACK_LIBRARY_PATH on Darwin (macOS) and
## LD_LIBRARY_PATH elsewhere.
## However, on macOS >=10.11 (if SIP is enabled, the default), the
## environment value will not be passed to a script such as R.sh, so
## would not seen here.
if test -z "${LD_LIBRARY_PATH}"; then
LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}"
else
LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}"
fi
export LD_LIBRARY_PATH

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

IMHO this is a bug in R. If you have $LD_LIBRARY_PATH set it should respect that

@nealrichardson

Copy link
Copy Markdown
Member

OIC, it puts its path before the one you provide. That's odd. If you reverse the order of the paths in that next to last line, does it work as expected?

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

This works fine

$ R_LD_LIBRARY_PATH=$LD_LIBRARY_PATH R CMD INSTALL .
* installing to library ‘/home/wesm/R/x86_64-pc-linux-gnu-library/3.6’
* installing *source* package ‘arrow’ ...
** using staged installation
Arrow C++ libraries found via pkg-config
PKG_CFLAGS=-I/home/wesm/local/include -DARROW_R_WITH_ARROW
PKG_LIBS=-L/home/wesm/local/lib -larrow -lparquet
** libs
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/home/wesm/local/include -DARROW_R_WITH_ARROW -I"/home/wesm/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include" -fvisibility=hidden -fpic -g -O2 -fdebug-prefix-map=/build/r-base-uuRxut/r-base-3.6.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c arrowExports.cpp -o arrowExports.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/home/wesm/local/include -DARROW_R_WITH_ARROW -I"/home/wesm/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include" -fvisibility=hidden -fpic -g -O2 -fdebug-prefix-map=/build/r-base-uuRxut/r-base-3.6.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c parquet.cpp -o parquet.o
g++ -std=gnu++11 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o arrow.so array.o array__to_vector.o array_from_vector.o arraydata.o arrowExports.o buffer.o chunkedarray.o compression.o compute.o csv.o datatype.o feather.o field.o io.o json.o memorypool.o message.o parquet.o recordbatch.o recordbatchreader.o recordbatchwriter.o schema.o symbols.o table.o threadpool.o -L/home/wesm/local/lib -larrow -lparquet -L/usr/lib/R/lib -lR
installing to /home/wesm/R/x86_64-pc-linux-gnu-library/3.6/00LOCK-r/00new/arrow/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (arrow)

I'll do that as a workaround. We should document it for developers

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

I guess I can kind of understand the point of view of wanting to isolate R from being contaminated by the user's environment, including modifications of LD_LIBRARY_PATH. Since if you build a package when LD_LIBRARY_PATH set and then unset it, that package could be broken

@codecov-io

Copy link
Copy Markdown

Codecov Report

Merging #5036 into master will increase coverage by 1.59%.
The diff coverage is 94.25%.

Impacted file tree graph

@@ Coverage Diff @@## master #5036 +/- ##
==========================================
+ Coverage 87.57% 89.17% +1.59% 
==========================================
Files 1008 727 -281 Lines 143814 102958 -40856 Branches 1418 0 -1418 ==========================================
- Hits 125952 91814 -34138 + Misses 17500 11144 -6356 + Partials 362 0 -362
Impacted FilesCoverage Δ
cpp/src/parquet/arrow/reader_internal.cc91.27% <ø> (ø)⬆️
cpp/src/parquet/arrow/reader_internal.h93.02% <ø> (ø)⬆️
cpp/src/parquet/arrow/reader.h80% <ø> (-12.31%)⬇️
cpp/src/parquet/schema.cc90.01% <ø> (ø)⬆️
cpp/src/parquet/arrow/writer.h100% <ø> (ø)⬆️
cpp/src/parquet/types.h100% <ø> (ø)⬆️
cpp/src/parquet/arrow/reader.cc84.86% <ø> (-0.13%)⬇️
cpp/src/parquet/column_writer.h95.65% <100%> (+6.76%)⬆️
cpp/src/parquet/arrow/arrow-reader-writer-test.cc93.73% <100%> (ø)⬆️
cpp/src/parquet/properties.cc73.33% <100%> (+17.77%)⬆️
... and 290 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d549b7c...b2ddcb3. Read the comment docs.

@wesmwesm closed this in b4c1763Aug 9, 2019
@wesm
wesm deleted the ARROW-6152 branch August 9, 2019 01:23
@nealrichardson

Copy link
Copy Markdown
Member

If it's a bug, it's been around a while. I traced it back to a commit from the end of the Clinton presidency: wch/r-source@b4f9299

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@wesm@nealrichardson@codecov-io@hatemhelal
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

ARROW-6152: [C++][Parquet] Add parquet::ColumnWriter::WriteArrow method, refactor - #5036

Closed
wesm wants to merge 10 commits into
apache:masterfrom
wesm:ARROW-6152
Closed

ARROW-6152: [C++][Parquet] Add parquet::ColumnWriter::WriteArrow method, refactor #5036
wesm wants to merge 10 commits into
apache:masterfrom
wesm:ARROW-6152

Conversation

@wesm

@wesmwesm commented Aug 8, 2019

Copy link
Copy Markdown
Member
  • Write Arrow arrays directly to ColumnWriter, to allow internal optimizations and other features, like direct DictionaryArray writes
  • Refactor and streamline implementation for maintainability and readability
  • Move Arrow reader/writer properties to parquet/properties.h
  • Some minor miscellaneous code reorganization to help

Functionally the library is unchanged

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

cc @hatemhelal@xhochy

@hatemhelalhatemhelal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, looks good to me.

Comment threadcpp/src/parquet/properties.h Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't tell without compiling but I wondered if this could be done in the member initializer list:

 ArrowWriteContext(MemoryPool* memory_pool, ArrowWriterProperties* properties)
: memory_pool(memory_pool), properties(properties), data_buffer(AllocateBuffer(memory_pool)),
def_levels_buffer(AllocateBuffer(memory_pool)) { }

This might fall in the category of a micro (or even nano) optimization.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll make this change

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

@romainfrancois@nealrichardson I've noted that when I run R CMD INSTALL . that when the R extension is tested, system library paths are given precedence over the contents of $LD_LIBRARY_PATH. This is very annoying for me because there is an older version of liblz4 in Ubuntu 18.04's system paths that is incompatible with the one that we use in libarrow.so. Do you know any way to fix this? I can also open a JIRA issue

@nealrichardson

Copy link
Copy Markdown
Member

@wesm can you provide a traceback/console output of what the failure looks like/where it happens?

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor
$ R CMD INSTALL .
* installing to library ‘/home/wesm/R/x86_64-pc-linux-gnu-library/3.6’
* installing *source* package ‘arrow’ ...
** using staged installation
Arrow C++ libraries found via pkg-config
PKG_CFLAGS=-I/home/wesm/local/include -DARROW_R_WITH_ARROW
PKG_LIBS=-L/home/wesm/local/lib -larrow -lparquet
** libs
make: Nothing to be done for 'all'.
installing to /home/wesm/R/x86_64-pc-linux-gnu-library/3.6/00LOCK-r/00new/arrow/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘arrow’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/wesm/R/x86_64-pc-linux-gnu-library/3.6/00LOCK-r/00new/arrow/libs/arrow.so':
/home/wesm/local/lib/libarrow.so.100: undefined symbol: LZ4F_resetDecompressionContext
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/wesm/R/x86_64-pc-linux-gnu-library/3.6/arrow’
* restoring previous ‘/home/wesm/R/x86_64-pc-linux-gnu-library/3.6/arrow’

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

And of course

$ ldd ~/local/lib/libarrow.so
linux-vdso.so.1 (0x00007ffd2bcfc000)
libcrypto.so.1.1 => /home/wesm/cpp-runtime-toolchain/lib/libcrypto.so.1.1 (0x00007fce910f2000)
libssl.so.1.1 => /home/wesm/cpp-runtime-toolchain/lib/libssl.so.1.1 (0x00007fce92fe4000)
libglog.so.0 => /home/wesm/cpp-runtime-toolchain/lib/libglog.so.0 (0x00007fce92fab000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fce90eee000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fce90ce6000)
libbz2.so.1.0 => /home/wesm/cpp-runtime-toolchain/lib/libbz2.so.1.0 (0x00007fce92f73000)
liblz4.so.1 => /home/wesm/cpp-runtime-toolchain/lib/liblz4.so.1 (0x00007fce92f3b000)
libsnappy.so.1 => /home/wesm/cpp-runtime-toolchain/lib/libsnappy.so.1 (0x00007fce92f30000)
libz.so.1 => /home/wesm/cpp-runtime-toolchain/lib/libz.so.1 (0x00007fce92f16000)
libzstd.so.1 => /home/wesm/cpp-runtime-toolchain/lib/libzstd.so.1 (0x00007fce90a49000)
libboost_system.so.1.70.0 => /home/wesm/cpp-runtime-toolchain/lib/libboost_system.so.1.70.0 (0x00007fce92f11000)
libboost_filesystem.so.1.70.0 => /home/wesm/cpp-runtime-toolchain/lib/libboost_filesystem.so.1.70.0 (0x00007fce92eef000)
libstdc++.so.6 => /home/wesm/cpp-runtime-toolchain/lib/libstdc++.so.6 (0x00007fce908d5000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fce90537000)
libgcc_s.so.1 => /home/wesm/cpp-runtime-toolchain/lib/libgcc_s.so.1 (0x00007fce92edb000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fce90318000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fce8ff27000)
/lib64/ld-linux-x86-64.so.2 (0x00007fce92e4f000)
libgflags.so.2.2 => /home/wesm/cpp-runtime-toolchain/lib/./libgflags.so.2.2 (0x00007fce92eb5000)

So outside of the context of R CMD INSTALL the correct liblz4.so is resolved

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

+1, will merge this PR once Travis CI runs...

@nealrichardson

Copy link
Copy Markdown
Member

One thing you can check out is what is in $(R RHOME)/etc/ldpaths. I saw that referenced in The Bible. Maybe you can amend that and it will pick up the right path? Or make it pay attention to the LD_LIBRARY_PATH you set? Totally guessing though, this is not my area of expertise.

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

Ugh

$ cat /etc/R/ldpaths : ${JAVA_HOME=/usr/lib/jvm/default-java}
: ${R_JAVA_LD_LIBRARY_PATH=${JAVA_HOME}/lib/server}
if test -n "/usr/lib/x86_64-linux-gnu"; then
: ${R_LD_LIBRARY_PATH=${R_HOME}/lib:/usr/lib/x86_64-linux-gnu}
else
: ${R_LD_LIBRARY_PATH=${R_HOME}/lib}
fi
if test -n "${R_JAVA_LD_LIBRARY_PATH}"; then
R_LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}:${R_JAVA_LD_LIBRARY_PATH}"
fi
## This is DYLD_FALLBACK_LIBRARY_PATH on Darwin (macOS) and
## LD_LIBRARY_PATH elsewhere.
## However, on macOS >=10.11 (if SIP is enabled, the default), the
## environment value will not be passed to a script such as R.sh, so
## would not seen here.
if test -z "${LD_LIBRARY_PATH}"; then
LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}"
else
LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}"
fi
export LD_LIBRARY_PATH

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

IMHO this is a bug in R. If you have $LD_LIBRARY_PATH set it should respect that

@nealrichardson

Copy link
Copy Markdown
Member

OIC, it puts its path before the one you provide. That's odd. If you reverse the order of the paths in that next to last line, does it work as expected?

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

This works fine

$ R_LD_LIBRARY_PATH=$LD_LIBRARY_PATH R CMD INSTALL .
* installing to library ‘/home/wesm/R/x86_64-pc-linux-gnu-library/3.6’
* installing *source* package ‘arrow’ ...
** using staged installation
Arrow C++ libraries found via pkg-config
PKG_CFLAGS=-I/home/wesm/local/include -DARROW_R_WITH_ARROW
PKG_LIBS=-L/home/wesm/local/lib -larrow -lparquet
** libs
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/home/wesm/local/include -DARROW_R_WITH_ARROW -I"/home/wesm/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include" -fvisibility=hidden -fpic -g -O2 -fdebug-prefix-map=/build/r-base-uuRxut/r-base-3.6.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c arrowExports.cpp -o arrowExports.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/home/wesm/local/include -DARROW_R_WITH_ARROW -I"/home/wesm/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include" -fvisibility=hidden -fpic -g -O2 -fdebug-prefix-map=/build/r-base-uuRxut/r-base-3.6.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c parquet.cpp -o parquet.o
g++ -std=gnu++11 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o arrow.so array.o array__to_vector.o array_from_vector.o arraydata.o arrowExports.o buffer.o chunkedarray.o compression.o compute.o csv.o datatype.o feather.o field.o io.o json.o memorypool.o message.o parquet.o recordbatch.o recordbatchreader.o recordbatchwriter.o schema.o symbols.o table.o threadpool.o -L/home/wesm/local/lib -larrow -lparquet -L/usr/lib/R/lib -lR
installing to /home/wesm/R/x86_64-pc-linux-gnu-library/3.6/00LOCK-r/00new/arrow/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (arrow)

I'll do that as a workaround. We should document it for developers

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

I guess I can kind of understand the point of view of wanting to isolate R from being contaminated by the user's environment, including modifications of LD_LIBRARY_PATH. Since if you build a package when LD_LIBRARY_PATH set and then unset it, that package could be broken

@codecov-io

Copy link
Copy Markdown

Codecov Report

Merging #5036 into master will increase coverage by 1.59%.
The diff coverage is 94.25%.

Impacted file tree graph

@@ Coverage Diff @@## master #5036 +/- ##
==========================================
+ Coverage 87.57% 89.17% +1.59% 
==========================================
Files 1008 727 -281 Lines 143814 102958 -40856 Branches 1418 0 -1418 ==========================================
- Hits 125952 91814 -34138 + Misses 17500 11144 -6356 + Partials 362 0 -362
Impacted FilesCoverage Δ
cpp/src/parquet/arrow/reader_internal.cc91.27% <ø> (ø)⬆️
cpp/src/parquet/arrow/reader_internal.h93.02% <ø> (ø)⬆️
cpp/src/parquet/arrow/reader.h80% <ø> (-12.31%)⬇️
cpp/src/parquet/schema.cc90.01% <ø> (ø)⬆️
cpp/src/parquet/arrow/writer.h100% <ø> (ø)⬆️
cpp/src/parquet/types.h100% <ø> (ø)⬆️
cpp/src/parquet/arrow/reader.cc84.86% <ø> (-0.13%)⬇️
cpp/src/parquet/column_writer.h95.65% <100%> (+6.76%)⬆️
cpp/src/parquet/arrow/arrow-reader-writer-test.cc93.73% <100%> (ø)⬆️
cpp/src/parquet/properties.cc73.33% <100%> (+17.77%)⬆️
... and 290 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d549b7c...b2ddcb3. Read the comment docs.

@wesmwesm closed this in b4c1763Aug 9, 2019
@wesm
wesm deleted the ARROW-6152 branch August 9, 2019 01:23
@nealrichardson

Copy link
Copy Markdown
Member

If it's a bug, it's been around a while. I traced it back to a commit from the end of the Clinton presidency: wch/r-source@b4f9299

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@wesm@nealrichardson@codecov-io@hatemhelal
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

ARROW-6152: [C++][Parquet] Add parquet::ColumnWriter::WriteArrow method, refactor - #5036

Closed
wesm wants to merge 10 commits into
apache:masterfrom
wesm:ARROW-6152
Closed

ARROW-6152: [C++][Parquet] Add parquet::ColumnWriter::WriteArrow method, refactor #5036
wesm wants to merge 10 commits into
apache:masterfrom
wesm:ARROW-6152

Conversation

@wesm

@wesmwesm commented Aug 8, 2019

Copy link
Copy Markdown
Member
  • Write Arrow arrays directly to ColumnWriter, to allow internal optimizations and other features, like direct DictionaryArray writes
  • Refactor and streamline implementation for maintainability and readability
  • Move Arrow reader/writer properties to parquet/properties.h
  • Some minor miscellaneous code reorganization to help

Functionally the library is unchanged

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

cc @hatemhelal@xhochy

@hatemhelalhatemhelal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, looks good to me.

Comment threadcpp/src/parquet/properties.h Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't tell without compiling but I wondered if this could be done in the member initializer list:

 ArrowWriteContext(MemoryPool* memory_pool, ArrowWriterProperties* properties)
: memory_pool(memory_pool), properties(properties), data_buffer(AllocateBuffer(memory_pool)),
def_levels_buffer(AllocateBuffer(memory_pool)) { }

This might fall in the category of a micro (or even nano) optimization.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll make this change

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

@romainfrancois@nealrichardson I've noted that when I run R CMD INSTALL . that when the R extension is tested, system library paths are given precedence over the contents of $LD_LIBRARY_PATH. This is very annoying for me because there is an older version of liblz4 in Ubuntu 18.04's system paths that is incompatible with the one that we use in libarrow.so. Do you know any way to fix this? I can also open a JIRA issue

@nealrichardson

Copy link
Copy Markdown
Member

@wesm can you provide a traceback/console output of what the failure looks like/where it happens?

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor
$ R CMD INSTALL .
* installing to library ‘/home/wesm/R/x86_64-pc-linux-gnu-library/3.6’
* installing *source* package ‘arrow’ ...
** using staged installation
Arrow C++ libraries found via pkg-config
PKG_CFLAGS=-I/home/wesm/local/include -DARROW_R_WITH_ARROW
PKG_LIBS=-L/home/wesm/local/lib -larrow -lparquet
** libs
make: Nothing to be done for 'all'.
installing to /home/wesm/R/x86_64-pc-linux-gnu-library/3.6/00LOCK-r/00new/arrow/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘arrow’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/wesm/R/x86_64-pc-linux-gnu-library/3.6/00LOCK-r/00new/arrow/libs/arrow.so':
/home/wesm/local/lib/libarrow.so.100: undefined symbol: LZ4F_resetDecompressionContext
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/wesm/R/x86_64-pc-linux-gnu-library/3.6/arrow’
* restoring previous ‘/home/wesm/R/x86_64-pc-linux-gnu-library/3.6/arrow’

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

And of course

$ ldd ~/local/lib/libarrow.so
linux-vdso.so.1 (0x00007ffd2bcfc000)
libcrypto.so.1.1 => /home/wesm/cpp-runtime-toolchain/lib/libcrypto.so.1.1 (0x00007fce910f2000)
libssl.so.1.1 => /home/wesm/cpp-runtime-toolchain/lib/libssl.so.1.1 (0x00007fce92fe4000)
libglog.so.0 => /home/wesm/cpp-runtime-toolchain/lib/libglog.so.0 (0x00007fce92fab000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fce90eee000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fce90ce6000)
libbz2.so.1.0 => /home/wesm/cpp-runtime-toolchain/lib/libbz2.so.1.0 (0x00007fce92f73000)
liblz4.so.1 => /home/wesm/cpp-runtime-toolchain/lib/liblz4.so.1 (0x00007fce92f3b000)
libsnappy.so.1 => /home/wesm/cpp-runtime-toolchain/lib/libsnappy.so.1 (0x00007fce92f30000)
libz.so.1 => /home/wesm/cpp-runtime-toolchain/lib/libz.so.1 (0x00007fce92f16000)
libzstd.so.1 => /home/wesm/cpp-runtime-toolchain/lib/libzstd.so.1 (0x00007fce90a49000)
libboost_system.so.1.70.0 => /home/wesm/cpp-runtime-toolchain/lib/libboost_system.so.1.70.0 (0x00007fce92f11000)
libboost_filesystem.so.1.70.0 => /home/wesm/cpp-runtime-toolchain/lib/libboost_filesystem.so.1.70.0 (0x00007fce92eef000)
libstdc++.so.6 => /home/wesm/cpp-runtime-toolchain/lib/libstdc++.so.6 (0x00007fce908d5000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fce90537000)
libgcc_s.so.1 => /home/wesm/cpp-runtime-toolchain/lib/libgcc_s.so.1 (0x00007fce92edb000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fce90318000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fce8ff27000)
/lib64/ld-linux-x86-64.so.2 (0x00007fce92e4f000)
libgflags.so.2.2 => /home/wesm/cpp-runtime-toolchain/lib/./libgflags.so.2.2 (0x00007fce92eb5000)

So outside of the context of R CMD INSTALL the correct liblz4.so is resolved

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

+1, will merge this PR once Travis CI runs...

@nealrichardson

Copy link
Copy Markdown
Member

One thing you can check out is what is in $(R RHOME)/etc/ldpaths. I saw that referenced in The Bible. Maybe you can amend that and it will pick up the right path? Or make it pay attention to the LD_LIBRARY_PATH you set? Totally guessing though, this is not my area of expertise.

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

Ugh

$ cat /etc/R/ldpaths : ${JAVA_HOME=/usr/lib/jvm/default-java}
: ${R_JAVA_LD_LIBRARY_PATH=${JAVA_HOME}/lib/server}
if test -n "/usr/lib/x86_64-linux-gnu"; then
: ${R_LD_LIBRARY_PATH=${R_HOME}/lib:/usr/lib/x86_64-linux-gnu}
else
: ${R_LD_LIBRARY_PATH=${R_HOME}/lib}
fi
if test -n "${R_JAVA_LD_LIBRARY_PATH}"; then
R_LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}:${R_JAVA_LD_LIBRARY_PATH}"
fi
## This is DYLD_FALLBACK_LIBRARY_PATH on Darwin (macOS) and
## LD_LIBRARY_PATH elsewhere.
## However, on macOS >=10.11 (if SIP is enabled, the default), the
## environment value will not be passed to a script such as R.sh, so
## would not seen here.
if test -z "${LD_LIBRARY_PATH}"; then
LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}"
else
LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}"
fi
export LD_LIBRARY_PATH

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

IMHO this is a bug in R. If you have $LD_LIBRARY_PATH set it should respect that

@nealrichardson

Copy link
Copy Markdown
Member

OIC, it puts its path before the one you provide. That's odd. If you reverse the order of the paths in that next to last line, does it work as expected?

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

This works fine

$ R_LD_LIBRARY_PATH=$LD_LIBRARY_PATH R CMD INSTALL .
* installing to library ‘/home/wesm/R/x86_64-pc-linux-gnu-library/3.6’
* installing *source* package ‘arrow’ ...
** using staged installation
Arrow C++ libraries found via pkg-config
PKG_CFLAGS=-I/home/wesm/local/include -DARROW_R_WITH_ARROW
PKG_LIBS=-L/home/wesm/local/lib -larrow -lparquet
** libs
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/home/wesm/local/include -DARROW_R_WITH_ARROW -I"/home/wesm/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include" -fvisibility=hidden -fpic -g -O2 -fdebug-prefix-map=/build/r-base-uuRxut/r-base-3.6.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c arrowExports.cpp -o arrowExports.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/home/wesm/local/include -DARROW_R_WITH_ARROW -I"/home/wesm/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include" -fvisibility=hidden -fpic -g -O2 -fdebug-prefix-map=/build/r-base-uuRxut/r-base-3.6.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c parquet.cpp -o parquet.o
g++ -std=gnu++11 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o arrow.so array.o array__to_vector.o array_from_vector.o arraydata.o arrowExports.o buffer.o chunkedarray.o compression.o compute.o csv.o datatype.o feather.o field.o io.o json.o memorypool.o message.o parquet.o recordbatch.o recordbatchreader.o recordbatchwriter.o schema.o symbols.o table.o threadpool.o -L/home/wesm/local/lib -larrow -lparquet -L/usr/lib/R/lib -lR
installing to /home/wesm/R/x86_64-pc-linux-gnu-library/3.6/00LOCK-r/00new/arrow/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (arrow)

I'll do that as a workaround. We should document it for developers

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

I guess I can kind of understand the point of view of wanting to isolate R from being contaminated by the user's environment, including modifications of LD_LIBRARY_PATH. Since if you build a package when LD_LIBRARY_PATH set and then unset it, that package could be broken

@codecov-io

Copy link
Copy Markdown

Codecov Report

Merging #5036 into master will increase coverage by 1.59%.
The diff coverage is 94.25%.

Impacted file tree graph

@@ Coverage Diff @@## master #5036 +/- ##
==========================================
+ Coverage 87.57% 89.17% +1.59% 
==========================================
Files 1008 727 -281 Lines 143814 102958 -40856 Branches 1418 0 -1418 ==========================================
- Hits 125952 91814 -34138 + Misses 17500 11144 -6356 + Partials 362 0 -362
Impacted FilesCoverage Δ
cpp/src/parquet/arrow/reader_internal.cc91.27% <ø> (ø)⬆️
cpp/src/parquet/arrow/reader_internal.h93.02% <ø> (ø)⬆️
cpp/src/parquet/arrow/reader.h80% <ø> (-12.31%)⬇️
cpp/src/parquet/schema.cc90.01% <ø> (ø)⬆️
cpp/src/parquet/arrow/writer.h100% <ø> (ø)⬆️
cpp/src/parquet/types.h100% <ø> (ø)⬆️
cpp/src/parquet/arrow/reader.cc84.86% <ø> (-0.13%)⬇️
cpp/src/parquet/column_writer.h95.65% <100%> (+6.76%)⬆️
cpp/src/parquet/arrow/arrow-reader-writer-test.cc93.73% <100%> (ø)⬆️
cpp/src/parquet/properties.cc73.33% <100%> (+17.77%)⬆️
... and 290 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d549b7c...b2ddcb3. Read the comment docs.

@wesmwesm closed this in b4c1763Aug 9, 2019
@wesm
wesm deleted the ARROW-6152 branch August 9, 2019 01:23
@nealrichardson

Copy link
Copy Markdown
Member

If it's a bug, it's been around a while. I traced it back to a commit from the end of the Clinton presidency: wch/r-source@b4f9299

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@wesm@nealrichardson@codecov-io@hatemhelal
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

ARROW-6152: [C++][Parquet] Add parquet::ColumnWriter::WriteArrow method, refactor - #5036

Closed
wesm wants to merge 10 commits into
apache:masterfrom
wesm:ARROW-6152
Closed

ARROW-6152: [C++][Parquet] Add parquet::ColumnWriter::WriteArrow method, refactor #5036
wesm wants to merge 10 commits into
apache:masterfrom
wesm:ARROW-6152

Conversation

@wesm

@wesmwesm commented Aug 8, 2019

Copy link
Copy Markdown
Member
  • Write Arrow arrays directly to ColumnWriter, to allow internal optimizations and other features, like direct DictionaryArray writes
  • Refactor and streamline implementation for maintainability and readability
  • Move Arrow reader/writer properties to parquet/properties.h
  • Some minor miscellaneous code reorganization to help

Functionally the library is unchanged

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

cc @hatemhelal@xhochy

@hatemhelalhatemhelal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, looks good to me.

Comment threadcpp/src/parquet/properties.h Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't tell without compiling but I wondered if this could be done in the member initializer list:

 ArrowWriteContext(MemoryPool* memory_pool, ArrowWriterProperties* properties)
: memory_pool(memory_pool), properties(properties), data_buffer(AllocateBuffer(memory_pool)),
def_levels_buffer(AllocateBuffer(memory_pool)) { }

This might fall in the category of a micro (or even nano) optimization.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll make this change

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

@romainfrancois@nealrichardson I've noted that when I run R CMD INSTALL . that when the R extension is tested, system library paths are given precedence over the contents of $LD_LIBRARY_PATH. This is very annoying for me because there is an older version of liblz4 in Ubuntu 18.04's system paths that is incompatible with the one that we use in libarrow.so. Do you know any way to fix this? I can also open a JIRA issue

@nealrichardson

Copy link
Copy Markdown
Member

@wesm can you provide a traceback/console output of what the failure looks like/where it happens?

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor
$ R CMD INSTALL .
* installing to library ‘/home/wesm/R/x86_64-pc-linux-gnu-library/3.6’
* installing *source* package ‘arrow’ ...
** using staged installation
Arrow C++ libraries found via pkg-config
PKG_CFLAGS=-I/home/wesm/local/include -DARROW_R_WITH_ARROW
PKG_LIBS=-L/home/wesm/local/lib -larrow -lparquet
** libs
make: Nothing to be done for 'all'.
installing to /home/wesm/R/x86_64-pc-linux-gnu-library/3.6/00LOCK-r/00new/arrow/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘arrow’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/wesm/R/x86_64-pc-linux-gnu-library/3.6/00LOCK-r/00new/arrow/libs/arrow.so':
/home/wesm/local/lib/libarrow.so.100: undefined symbol: LZ4F_resetDecompressionContext
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/wesm/R/x86_64-pc-linux-gnu-library/3.6/arrow’
* restoring previous ‘/home/wesm/R/x86_64-pc-linux-gnu-library/3.6/arrow’

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

And of course

$ ldd ~/local/lib/libarrow.so
linux-vdso.so.1 (0x00007ffd2bcfc000)
libcrypto.so.1.1 => /home/wesm/cpp-runtime-toolchain/lib/libcrypto.so.1.1 (0x00007fce910f2000)
libssl.so.1.1 => /home/wesm/cpp-runtime-toolchain/lib/libssl.so.1.1 (0x00007fce92fe4000)
libglog.so.0 => /home/wesm/cpp-runtime-toolchain/lib/libglog.so.0 (0x00007fce92fab000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fce90eee000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fce90ce6000)
libbz2.so.1.0 => /home/wesm/cpp-runtime-toolchain/lib/libbz2.so.1.0 (0x00007fce92f73000)
liblz4.so.1 => /home/wesm/cpp-runtime-toolchain/lib/liblz4.so.1 (0x00007fce92f3b000)
libsnappy.so.1 => /home/wesm/cpp-runtime-toolchain/lib/libsnappy.so.1 (0x00007fce92f30000)
libz.so.1 => /home/wesm/cpp-runtime-toolchain/lib/libz.so.1 (0x00007fce92f16000)
libzstd.so.1 => /home/wesm/cpp-runtime-toolchain/lib/libzstd.so.1 (0x00007fce90a49000)
libboost_system.so.1.70.0 => /home/wesm/cpp-runtime-toolchain/lib/libboost_system.so.1.70.0 (0x00007fce92f11000)
libboost_filesystem.so.1.70.0 => /home/wesm/cpp-runtime-toolchain/lib/libboost_filesystem.so.1.70.0 (0x00007fce92eef000)
libstdc++.so.6 => /home/wesm/cpp-runtime-toolchain/lib/libstdc++.so.6 (0x00007fce908d5000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fce90537000)
libgcc_s.so.1 => /home/wesm/cpp-runtime-toolchain/lib/libgcc_s.so.1 (0x00007fce92edb000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fce90318000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fce8ff27000)
/lib64/ld-linux-x86-64.so.2 (0x00007fce92e4f000)
libgflags.so.2.2 => /home/wesm/cpp-runtime-toolchain/lib/./libgflags.so.2.2 (0x00007fce92eb5000)

So outside of the context of R CMD INSTALL the correct liblz4.so is resolved

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

+1, will merge this PR once Travis CI runs...

@nealrichardson

Copy link
Copy Markdown
Member

One thing you can check out is what is in $(R RHOME)/etc/ldpaths. I saw that referenced in The Bible. Maybe you can amend that and it will pick up the right path? Or make it pay attention to the LD_LIBRARY_PATH you set? Totally guessing though, this is not my area of expertise.

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

Ugh

$ cat /etc/R/ldpaths : ${JAVA_HOME=/usr/lib/jvm/default-java}
: ${R_JAVA_LD_LIBRARY_PATH=${JAVA_HOME}/lib/server}
if test -n "/usr/lib/x86_64-linux-gnu"; then
: ${R_LD_LIBRARY_PATH=${R_HOME}/lib:/usr/lib/x86_64-linux-gnu}
else
: ${R_LD_LIBRARY_PATH=${R_HOME}/lib}
fi
if test -n "${R_JAVA_LD_LIBRARY_PATH}"; then
R_LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}:${R_JAVA_LD_LIBRARY_PATH}"
fi
## This is DYLD_FALLBACK_LIBRARY_PATH on Darwin (macOS) and
## LD_LIBRARY_PATH elsewhere.
## However, on macOS >=10.11 (if SIP is enabled, the default), the
## environment value will not be passed to a script such as R.sh, so
## would not seen here.
if test -z "${LD_LIBRARY_PATH}"; then
LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}"
else
LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}"
fi
export LD_LIBRARY_PATH

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

IMHO this is a bug in R. If you have $LD_LIBRARY_PATH set it should respect that

@nealrichardson

Copy link
Copy Markdown
Member

OIC, it puts its path before the one you provide. That's odd. If you reverse the order of the paths in that next to last line, does it work as expected?

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

This works fine

$ R_LD_LIBRARY_PATH=$LD_LIBRARY_PATH R CMD INSTALL .
* installing to library ‘/home/wesm/R/x86_64-pc-linux-gnu-library/3.6’
* installing *source* package ‘arrow’ ...
** using staged installation
Arrow C++ libraries found via pkg-config
PKG_CFLAGS=-I/home/wesm/local/include -DARROW_R_WITH_ARROW
PKG_LIBS=-L/home/wesm/local/lib -larrow -lparquet
** libs
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/home/wesm/local/include -DARROW_R_WITH_ARROW -I"/home/wesm/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include" -fvisibility=hidden -fpic -g -O2 -fdebug-prefix-map=/build/r-base-uuRxut/r-base-3.6.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c arrowExports.cpp -o arrowExports.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/home/wesm/local/include -DARROW_R_WITH_ARROW -I"/home/wesm/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include" -fvisibility=hidden -fpic -g -O2 -fdebug-prefix-map=/build/r-base-uuRxut/r-base-3.6.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c parquet.cpp -o parquet.o
g++ -std=gnu++11 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o arrow.so array.o array__to_vector.o array_from_vector.o arraydata.o arrowExports.o buffer.o chunkedarray.o compression.o compute.o csv.o datatype.o feather.o field.o io.o json.o memorypool.o message.o parquet.o recordbatch.o recordbatchreader.o recordbatchwriter.o schema.o symbols.o table.o threadpool.o -L/home/wesm/local/lib -larrow -lparquet -L/usr/lib/R/lib -lR
installing to /home/wesm/R/x86_64-pc-linux-gnu-library/3.6/00LOCK-r/00new/arrow/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (arrow)

I'll do that as a workaround. We should document it for developers

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

I guess I can kind of understand the point of view of wanting to isolate R from being contaminated by the user's environment, including modifications of LD_LIBRARY_PATH. Since if you build a package when LD_LIBRARY_PATH set and then unset it, that package could be broken

@codecov-io

Copy link
Copy Markdown

Codecov Report

Merging #5036 into master will increase coverage by 1.59%.
The diff coverage is 94.25%.

Impacted file tree graph

@@ Coverage Diff @@## master #5036 +/- ##
==========================================
+ Coverage 87.57% 89.17% +1.59% 
==========================================
Files 1008 727 -281 Lines 143814 102958 -40856 Branches 1418 0 -1418 ==========================================
- Hits 125952 91814 -34138 + Misses 17500 11144 -6356 + Partials 362 0 -362
Impacted FilesCoverage Δ
cpp/src/parquet/arrow/reader_internal.cc91.27% <ø> (ø)⬆️
cpp/src/parquet/arrow/reader_internal.h93.02% <ø> (ø)⬆️
cpp/src/parquet/arrow/reader.h80% <ø> (-12.31%)⬇️
cpp/src/parquet/schema.cc90.01% <ø> (ø)⬆️
cpp/src/parquet/arrow/writer.h100% <ø> (ø)⬆️
cpp/src/parquet/types.h100% <ø> (ø)⬆️
cpp/src/parquet/arrow/reader.cc84.86% <ø> (-0.13%)⬇️
cpp/src/parquet/column_writer.h95.65% <100%> (+6.76%)⬆️
cpp/src/parquet/arrow/arrow-reader-writer-test.cc93.73% <100%> (ø)⬆️
cpp/src/parquet/properties.cc73.33% <100%> (+17.77%)⬆️
... and 290 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d549b7c...b2ddcb3. Read the comment docs.

@wesmwesm closed this in b4c1763Aug 9, 2019
@wesm
wesm deleted the ARROW-6152 branch August 9, 2019 01:23
@nealrichardson

Copy link
Copy Markdown
Member

If it's a bug, it's been around a while. I traced it back to a commit from the end of the Clinton presidency: wch/r-source@b4f9299

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@wesm@nealrichardson@codecov-io@hatemhelal
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

ARROW-6152: [C++][Parquet] Add parquet::ColumnWriter::WriteArrow method, refactor - #5036

Closed
wesm wants to merge 10 commits into
apache:masterfrom
wesm:ARROW-6152
Closed

ARROW-6152: [C++][Parquet] Add parquet::ColumnWriter::WriteArrow method, refactor #5036
wesm wants to merge 10 commits into
apache:masterfrom
wesm:ARROW-6152

Conversation

@wesm

@wesmwesm commented Aug 8, 2019

Copy link
Copy Markdown
Member
  • Write Arrow arrays directly to ColumnWriter, to allow internal optimizations and other features, like direct DictionaryArray writes
  • Refactor and streamline implementation for maintainability and readability
  • Move Arrow reader/writer properties to parquet/properties.h
  • Some minor miscellaneous code reorganization to help

Functionally the library is unchanged

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

cc @hatemhelal@xhochy

@hatemhelalhatemhelal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, looks good to me.

Comment threadcpp/src/parquet/properties.h Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't tell without compiling but I wondered if this could be done in the member initializer list:

 ArrowWriteContext(MemoryPool* memory_pool, ArrowWriterProperties* properties)
: memory_pool(memory_pool), properties(properties), data_buffer(AllocateBuffer(memory_pool)),
def_levels_buffer(AllocateBuffer(memory_pool)) { }

This might fall in the category of a micro (or even nano) optimization.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll make this change

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

@romainfrancois@nealrichardson I've noted that when I run R CMD INSTALL . that when the R extension is tested, system library paths are given precedence over the contents of $LD_LIBRARY_PATH. This is very annoying for me because there is an older version of liblz4 in Ubuntu 18.04's system paths that is incompatible with the one that we use in libarrow.so. Do you know any way to fix this? I can also open a JIRA issue

@nealrichardson

Copy link
Copy Markdown
Member

@wesm can you provide a traceback/console output of what the failure looks like/where it happens?

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor
$ R CMD INSTALL .
* installing to library ‘/home/wesm/R/x86_64-pc-linux-gnu-library/3.6’
* installing *source* package ‘arrow’ ...
** using staged installation
Arrow C++ libraries found via pkg-config
PKG_CFLAGS=-I/home/wesm/local/include -DARROW_R_WITH_ARROW
PKG_LIBS=-L/home/wesm/local/lib -larrow -lparquet
** libs
make: Nothing to be done for 'all'.
installing to /home/wesm/R/x86_64-pc-linux-gnu-library/3.6/00LOCK-r/00new/arrow/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘arrow’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/wesm/R/x86_64-pc-linux-gnu-library/3.6/00LOCK-r/00new/arrow/libs/arrow.so':
/home/wesm/local/lib/libarrow.so.100: undefined symbol: LZ4F_resetDecompressionContext
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/wesm/R/x86_64-pc-linux-gnu-library/3.6/arrow’
* restoring previous ‘/home/wesm/R/x86_64-pc-linux-gnu-library/3.6/arrow’

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

And of course

$ ldd ~/local/lib/libarrow.so
linux-vdso.so.1 (0x00007ffd2bcfc000)
libcrypto.so.1.1 => /home/wesm/cpp-runtime-toolchain/lib/libcrypto.so.1.1 (0x00007fce910f2000)
libssl.so.1.1 => /home/wesm/cpp-runtime-toolchain/lib/libssl.so.1.1 (0x00007fce92fe4000)
libglog.so.0 => /home/wesm/cpp-runtime-toolchain/lib/libglog.so.0 (0x00007fce92fab000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fce90eee000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fce90ce6000)
libbz2.so.1.0 => /home/wesm/cpp-runtime-toolchain/lib/libbz2.so.1.0 (0x00007fce92f73000)
liblz4.so.1 => /home/wesm/cpp-runtime-toolchain/lib/liblz4.so.1 (0x00007fce92f3b000)
libsnappy.so.1 => /home/wesm/cpp-runtime-toolchain/lib/libsnappy.so.1 (0x00007fce92f30000)
libz.so.1 => /home/wesm/cpp-runtime-toolchain/lib/libz.so.1 (0x00007fce92f16000)
libzstd.so.1 => /home/wesm/cpp-runtime-toolchain/lib/libzstd.so.1 (0x00007fce90a49000)
libboost_system.so.1.70.0 => /home/wesm/cpp-runtime-toolchain/lib/libboost_system.so.1.70.0 (0x00007fce92f11000)
libboost_filesystem.so.1.70.0 => /home/wesm/cpp-runtime-toolchain/lib/libboost_filesystem.so.1.70.0 (0x00007fce92eef000)
libstdc++.so.6 => /home/wesm/cpp-runtime-toolchain/lib/libstdc++.so.6 (0x00007fce908d5000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fce90537000)
libgcc_s.so.1 => /home/wesm/cpp-runtime-toolchain/lib/libgcc_s.so.1 (0x00007fce92edb000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fce90318000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fce8ff27000)
/lib64/ld-linux-x86-64.so.2 (0x00007fce92e4f000)
libgflags.so.2.2 => /home/wesm/cpp-runtime-toolchain/lib/./libgflags.so.2.2 (0x00007fce92eb5000)

So outside of the context of R CMD INSTALL the correct liblz4.so is resolved

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

+1, will merge this PR once Travis CI runs...

@nealrichardson

Copy link
Copy Markdown
Member

One thing you can check out is what is in $(R RHOME)/etc/ldpaths. I saw that referenced in The Bible. Maybe you can amend that and it will pick up the right path? Or make it pay attention to the LD_LIBRARY_PATH you set? Totally guessing though, this is not my area of expertise.

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

Ugh

$ cat /etc/R/ldpaths : ${JAVA_HOME=/usr/lib/jvm/default-java}
: ${R_JAVA_LD_LIBRARY_PATH=${JAVA_HOME}/lib/server}
if test -n "/usr/lib/x86_64-linux-gnu"; then
: ${R_LD_LIBRARY_PATH=${R_HOME}/lib:/usr/lib/x86_64-linux-gnu}
else
: ${R_LD_LIBRARY_PATH=${R_HOME}/lib}
fi
if test -n "${R_JAVA_LD_LIBRARY_PATH}"; then
R_LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}:${R_JAVA_LD_LIBRARY_PATH}"
fi
## This is DYLD_FALLBACK_LIBRARY_PATH on Darwin (macOS) and
## LD_LIBRARY_PATH elsewhere.
## However, on macOS >=10.11 (if SIP is enabled, the default), the
## environment value will not be passed to a script such as R.sh, so
## would not seen here.
if test -z "${LD_LIBRARY_PATH}"; then
LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}"
else
LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}"
fi
export LD_LIBRARY_PATH

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

IMHO this is a bug in R. If you have $LD_LIBRARY_PATH set it should respect that

@nealrichardson

Copy link
Copy Markdown
Member

OIC, it puts its path before the one you provide. That's odd. If you reverse the order of the paths in that next to last line, does it work as expected?

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

This works fine

$ R_LD_LIBRARY_PATH=$LD_LIBRARY_PATH R CMD INSTALL .
* installing to library ‘/home/wesm/R/x86_64-pc-linux-gnu-library/3.6’
* installing *source* package ‘arrow’ ...
** using staged installation
Arrow C++ libraries found via pkg-config
PKG_CFLAGS=-I/home/wesm/local/include -DARROW_R_WITH_ARROW
PKG_LIBS=-L/home/wesm/local/lib -larrow -lparquet
** libs
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/home/wesm/local/include -DARROW_R_WITH_ARROW -I"/home/wesm/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include" -fvisibility=hidden -fpic -g -O2 -fdebug-prefix-map=/build/r-base-uuRxut/r-base-3.6.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c arrowExports.cpp -o arrowExports.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/home/wesm/local/include -DARROW_R_WITH_ARROW -I"/home/wesm/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include" -fvisibility=hidden -fpic -g -O2 -fdebug-prefix-map=/build/r-base-uuRxut/r-base-3.6.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c parquet.cpp -o parquet.o
g++ -std=gnu++11 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o arrow.so array.o array__to_vector.o array_from_vector.o arraydata.o arrowExports.o buffer.o chunkedarray.o compression.o compute.o csv.o datatype.o feather.o field.o io.o json.o memorypool.o message.o parquet.o recordbatch.o recordbatchreader.o recordbatchwriter.o schema.o symbols.o table.o threadpool.o -L/home/wesm/local/lib -larrow -lparquet -L/usr/lib/R/lib -lR
installing to /home/wesm/R/x86_64-pc-linux-gnu-library/3.6/00LOCK-r/00new/arrow/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (arrow)

I'll do that as a workaround. We should document it for developers

@wesm

wesm commented Aug 8, 2019

Copy link
Copy Markdown
MemberAuthor

I guess I can kind of understand the point of view of wanting to isolate R from being contaminated by the user's environment, including modifications of LD_LIBRARY_PATH. Since if you build a package when LD_LIBRARY_PATH set and then unset it, that package could be broken

@codecov-io

Copy link
Copy Markdown

Codecov Report

Merging #5036 into master will increase coverage by 1.59%.
The diff coverage is 94.25%.

Impacted file tree graph

@@ Coverage Diff @@## master #5036 +/- ##
==========================================
+ Coverage 87.57% 89.17% +1.59% 
==========================================
Files 1008 727 -281 Lines 143814 102958 -40856 Branches 1418 0 -1418 ==========================================
- Hits 125952 91814 -34138 + Misses 17500 11144 -6356 + Partials 362 0 -362
Impacted FilesCoverage Δ
cpp/src/parquet/arrow/reader_internal.cc91.27% <ø> (ø)⬆️
cpp/src/parquet/arrow/reader_internal.h93.02% <ø> (ø)⬆️
cpp/src/parquet/arrow/reader.h80% <ø> (-12.31%)⬇️
cpp/src/parquet/schema.cc90.01% <ø> (ø)⬆️
cpp/src/parquet/arrow/writer.h100% <ø> (ø)⬆️
cpp/src/parquet/types.h100% <ø> (ø)⬆️
cpp/src/parquet/arrow/reader.cc84.86% <ø> (-0.13%)⬇️
cpp/src/parquet/column_writer.h95.65% <100%> (+6.76%)⬆️
cpp/src/parquet/arrow/arrow-reader-writer-test.cc93.73% <100%> (ø)⬆️
cpp/src/parquet/properties.cc73.33% <100%> (+17.77%)⬆️
... and 290 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d549b7c...b2ddcb3. Read the comment docs.

@wesmwesm closed this in b4c1763Aug 9, 2019
@wesm
wesm deleted the ARROW-6152 branch August 9, 2019 01:23
@nealrichardson

Copy link
Copy Markdown
Member

If it's a bug, it's been around a while. I traced it back to a commit from the end of the Clinton presidency: wch/r-source@b4f9299

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@wesm@nealrichardson@codecov-io@hatemhelal