Skip to content

Apache DataFusion SQL Query Engine

ARROW-2116: [JS] implement IPC writers

ptaylorf6768187c876
diff --git a/ci/travis_env_common.sh b/ci/travis_env_common.sh
index 568070e043..42a3bbc4b5 100755
--- a/ci/travis_env_common.sh
+++ b/ci/travis_env_common.sh
@@ -17,6 +17,8 @@
# specific language governing permissions and limitations
# under the License.
+# hide nodejs experimental-feature warnings
+export NODE_NO_WARNINGS=1
export MINICONDA=$HOME/miniconda
export PATH="$MINICONDA/bin:$PATH"
export CONDA_PKGS_DIRS=$HOME/.conda_packages
diff --git a/integration/integration_test.py b/integration/integration_test.py
index 301017cac3..173fe54909 100644
--- a/integration/integration_test.py
+++ b/integration/integration_test.py
@@ -1092,15 +1092,19 @@ class CPPTester(Tester):
os.system(cmd)
class JSTester(Tester):
- PRODUCER = False
+ PRODUCER = True
CONSUMER = True
- INTEGRATION_EXE = os.path.join(ARROW_HOME, 'js/bin/integration.js')
+ EXE_PATH = os.path.join(ARROW_HOME, 'js/bin')
+ VALIDATE = os.path.join(EXE_PATH, 'integration.js')
+ JSON_TO_ARROW = os.path.join(EXE_PATH, 'json-to-arrow.js')
+ STREAM_TO_FILE = os.path.join(EXE_PATH, 'stream-to-file.js')
+ FILE_TO_STREAM = os.path.join(EXE_PATH, 'file-to-stream.js')
name = 'JS'
- def _run(self, arrow_path=None, json_path=None, command='VALIDATE'):
- cmd = [self.INTEGRATION_EXE]
+ def _run(self, exe_cmd, arrow_path=None, json_path=None, command='VALIDATE'):
+ cmd = [exe_cmd]
if arrow_path is not None:
cmd.extend(['-a', arrow_path])
@@ -1108,7 +1112,7 @@ class JSTester(Tester):
if json_path is not None:
cmd.extend(['-j', json_path])
- cmd.extend(['--mode', command])
+ cmd.extend(['--mode', command, '-t', 'es5', '-m', 'umd'])
if self.debug:
print(' '.join(cmd))
@@ -1116,11 +1120,24 @@ class JSTester(Tester):
run_cmd(cmd)
def validate(self, json_path, arrow_path):
- return self._run(arrow_path, json_path, 'VALIDATE')
+ return self._run(self.VALIDATE, arrow_path, json_path, 'VALIDATE')
+
+ def json_to_file(self, json_path, arrow_path):
+ cmd = ['node', self.JSON_TO_ARROW, '-a', arrow_path, '-j', json_path]
+ cmd = ' '.join(cmd)
+ if self.debug:
+ print(cmd)
+ os.system(cmd)
def stream_to_file(self, stream_path, file_path):
- # Just copy stream to file, we can read the stream directly
- cmd = ['cp', stream_path, file_path]
+ cmd = ['cat', stream_path, '|', 'node', self.STREAM_TO_FILE, '>', file_path]
+ cmd = ' '.join(cmd)
+ if self.debug:
+ print(cmd)
+ os.system(cmd)
+
+ def file_to_stream(self, file_path, stream_path):
+ cmd = ['cat', file_path, '|', 'node', self.FILE_TO_STREAM, '>', stream_path]
cmd = ' '.join(cmd)
if self.debug:
print(cmd)