안녕하세요,
Parquet 형식의 대용량 데이터셋(수 GB 정도)을 JMP로 효율적으로 가져와야 합니다. CSV 가져오기에 대한 설명 영상을 여기에서 보고, pd.read_parquet을 사용하는 동일한 방법을 사용해 보았습니다. 이 경우 테이블이 Pandas df 객체와 JMP dt 객체로 메모리를 모두 차지해야 하기 때문에 가져오기가 매우 비효율적일 것이라는 점이 걱정됩니다. 사양이 낮은 PC에 더 적합한 더 나은 방법이 있을까요?
정말 감사합니다.
무엇보다도 Parquet에서 JMP 데이터 테이블로 직접 메모리 내에서 작업하려면 충분한 RAM과 바이너리 파일 크기의 최소 2배, 아마도 3배 이상이 필요합니다. Python 통합과 PyArrow Python 패키지를 사용하세요.
import jmp
from jmputils import jpip
jpip('install','pyarrow')
다음은 Parquet 파일을 직접 탐색하고 Python에서 데이터를 사용하여 메모리 내에 데이터 테이블을 구축하는 JMP 18용 샘플 스크립트입니다.
JMP 18에서는 Python에서 데이터 및 데이터 테이블 열의 각 열을 한 번에 하나씩 탐색해야 합니다. Parquet 스키마와 데이터를 직접 탐색하거나 Parquet 테이블을 Pandas 데이터프레임으로 변환할 수 있습니다. Pandas 데이터프레임에서 jmp.DataTable 객체로 변환하는 예는 $SAMPLE_SCRIPTS/Python/dt2pandas2dt.jsl 및 .py 스크립트에서 확인할 수 있습니다.
# parquet.py
# Author: Paul R. Nelson
# JMP Statistical Discovery LLC
#
# Description:
# Directly read a pyarrow table and create a JMP datatable.
# The data for this file comes from a repository that is Apache licensed.
# https://github.com/Teradata/kylo/blob/master/samples/sample-data/parquet/userdata1.parquet
#
import jmp
import pyarrow.parquet as pq
ver = jmp.__version__.split('.')
if(ver[0] == '0' and ver[1] < '5'):
print('This version requires JMP 18.0 EA-5 or newer.')
pq_Table = pq.read_table('/Your_path/to/userdata1.parquet')
#print(pq_Table)
print(f'Table Rows: {len(pq_Table)}' )
print(f'Table Shape: {pq_Table.shape}')
print(f'Table Schema:\n{pq_Table.schema}')
print(f'Column Names: {pq_Table.column_names}')
#print(pq_Table.columns)
print(f'Num Columns: {pq_Table.num_columns}')
dt = jmp.DataTable('From Parquet', pq_Table.num_rows)
dt.new_column('first_name', jmp.DataType.Character)
dt.new_column('last_name', jmp.DataType.Character)
dt.new_column('Salary')
# set column properites (widths)
jmp.run_jsl('''
// Change column display width: last_name
Data Table( "From Parquet" ):last_name << Set Display Width( 105 );
// Change column display width: Salary
Data Table( "From Parquet" ):Salary << Set Display Width( 90 );
''')
#Create a data table column from a Python list
dt[0] = pq_Table.column(2).to_pylist()
dt[1] = pq_Table.column(3).to_pylist()
dt[2] = pq_Table.column(10).to_pylist()
# ===================================================================================
# Copyright © 2025 JMP Statistical Discovery LLC, Cary, NC, USA. All rights reserved.
#
# JMP STATISTICAL DISCOVERY LLC ("JMP") PERMITS THE USE OF THIS COMPUTER SOFTWARE
# CODE ("CODE") ON AN AS-IS BASIS AND AUTHORIZES YOU TO USE THE CODE SUBJECT TO
# THE TERMS LISTED HEREIN. BY USING THE CODE, YOU AGREE TO THESE TERMS. YOUR USE
# OF THE CODE IS AT YOUR OWN RISK. JMP MAKES NO REPRESENTATION OR WARRANTY,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND TITLE,
# WITH RESPECT TO THE CODE.
#
# You may use the Code solely as part of a software product you currently have
# licensed from JMP, JMP's parent company, SAS Institute Inc. ("SAS US") or one
# of SAS' subsidiaries (together with SAS US, "SAS") or authorized agents (the
# "Software"), and not for any other purpose. The Code is designed to either
# correct an error in the Software or to add functionality to the Software but
# has not necessarily been tested. Accordingly, JMP makes no representation or
# warranty that the Code (1) will operate error-free or (2) will not contain any
# viruses or other applications or executables (including, without limitation,
# any "trap doors," "worms" and "time bombs") that will degrade or infect any
# software product that you license from JMP or any other software or your
# network or systems. JMP is under no obligation to maintain, support, or
# continue to distribute the Code.
#
# Neither JMP nor its licensors shall be liable to you or any third party for any
# general, special, direct, indirect, consequential, incidental, or other damages
# whatsoever arising out of or related to your use or inability to use the Code,
# even if JMP has been advised of the possibility of such damages. Except as
# otherwise provided above, the Code is governed by the same agreement that
# governs the Software. If you do not have an existing agreement with JMP or SAS
# governing the Software, you may not use the Code.
#
# US export laws and regulations apply to the Code and any other JMP-provided
# technology ("Controlled Material"). The Controlled Material originates from the
# United States. Customer agrees to comply with these and other applicable export
# and import laws and regulations, except as prohibited or penalized by law
# ("Trade Law"). Customer warrants that Customer and its users are not: (a)
# prohibited by Trade Law from accessing Controlled Material without US
# government approval; (b) located in or under control of any country or other
# territory subject to general export or trade embargo under Trade Law; or (c)
# engaged in any of the following end-uses: nuclear, chemical or biological
# weapons; nuclear facilities not under International Atomic Energy Agency
# safeguards; missiles or unmanned aerial vehicles capable of long-range use or
# weapons delivery, military training or assistance, military or intelligence
# end-use in Russia or in any country in Country Group D:5 of the United States
# Export Administration Regulations; deep water, Arctic offshore or shale oil or
# gas exploration involving Russia or Russian companies, or Russian energy export
# pipelines. Customer will not import or use any data within the System that is
# subject to the US International Traffic Arms Regulations. United States export
# classification information for JMP software and its affiliates is available at
# jmp.com/export.
#
# JMP and all other JMP Statistical Discovery LLC product or service names are
# registered trademarks or trademarks of SAS Institute Inc. in the USA and other
# countries. ® indicates USA registration. Other brand and product names are
# registered trademarks or trademarks of their respective companies.
#
# ===================================================================================
JMP 19 EA-4+의 경우 상황이 훨씬 더 좋습니다.
import jmp
import numpy as np
import pandas as pd
import pyarrow.parquet as pq
#parque sample files from
# https://github.com/Teradata/kylo/tree/master/samples/sample-data/parquet
pq_Table = pq.read_table('/Your_path/to/userdata1.parquet')
pd_table = pq_Table.to_pandas()
#create table in memory from pandas datadata frame.
dt = jmp.from_dataframe(pd_table)
#Same Disclaimer applies.
파이썬 방식이 아마 아래 방법보다 나을 겁니다. 하지만 이 방법도, 적어도 장난감 파켓 파일에서는, 작동합니다.
Parquet 파일을 읽을 수 있는 Apache Drill 프로젝트가 있습니다. 이 프로젝트는 JDBC(ODBC가 아닌 Java)를 지원하려고 하는데, ODBC 드라이버가 아직 존재한다면 무료가 아닐 수도 있습니다. 하지만 REST 기반 API를 제공하며 JSL을 통해 이를 구현할 수 있습니다.
이 게시물의 1, 2, 3단계는 올바른 방향을 제시하고 있습니다(@ robertspierre 님, 감사합니다) . Windows에서 파일을 어떻게 추출해야 할지 잘 모르겠습니다. Linux에서 가능하고, 일부 Windows 도구도 가능할 것 같습니다. 저는 https://drill.apache.org/download/ 에서 "Drill for Hadoop 3 and non-Hadoop environments, direct download"를 선택했습니다. 또한 https://learn.microsoft.com/en-us/java/openjdk/download 에서 microsoft-jdk-21.0.6-windows-x64.msi를 다운로드했습니다.
확장된 apache-drill-1.21.2 디렉터리(tar.gz에서 가져옴)를 바탕 화면에 두고 다음과 같이 시작했습니다.

apache-drill-1.21.2로 cd 명령어를 입력한 후 bin/drill-embedded.bat 파일을 실행합니다. 그런 다음 제공된 Parquet 파일에 쿼리를 적용해 봤는데, JMP를 실행하고 다음 스크립트를 실행하면 됩니다.
fields = Associative Array();
fields["queryType"] = "SQL";
fields["query"] = "SELECT * FROM `dfs`.`C:\Users\c\Desktop\apache-drill-1.21.2\sample-data\nation.parquet`";
s = New HTTP Request( URL( "localhost:8047/query.json" ), Method( "POST" ), JSON( Fields( fields ) ), Headers( {"Accept: application/json"} ) ) <<SEND></SEND>
<P>그리고 이 표를 얻으세요:</P>
<BR />
<P><SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Craige_Hales_1-1744504821964.png" style="width: 999px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="Craige_Hales_1-1744504821964.png" style="width: 999px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="Craige_Hales_1-1744504821964.png" style="width: 999px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="Craige_Hales_1-1744504821964.png" style="width: 999px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="Craige_Hales_1-1744504821964.png" style="width: 999px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="Craige_Hales_1-1744504821964.png" style="width: 999px;"><span class="lia-inline-image-display-wrapper" image-alt="Craige_Hales_1-1744504821964.png" style="width: 999px;"><img src="https://us.v-cdn.net/6038925/uploads/images/74790iDA8A4CC22DE4CBA3/Craige_Hales_1-1744504821964.png" role="button" title="Craige_Hales_1-1744504821964.png" alt="Craige_Hales_1-1744504821964.png" /></span></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></P>
<BR />
<P>위의 드릴 프로세스를 시작하면 JSL에서 REST API 요청을 처리하는 웹서버가 시작됩니다. 또한 웹 인터페이스도 있는데, Parquet 파일을 읽는 데는 그다지 유용하지 않을 것 같습니다.</P>
<P><SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Craige_Hales_2-1744505945837.png" style="width: 999px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="Craige_Hales_2-1744505945837.png" style="width: 989px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="Craige_Hales_2-1744505945837.png" style="width: 989px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="Craige_Hales_2-1744505945837.png" style="width: 989px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="Craige_Hales_2-1744505945837.png" style="width: 989px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="Craige_Hales_2-1744505945837.png" style="width: 989px;"><span class="lia-inline-image-display-wrapper" image-alt="Craige_Hales_2-1744505945837.png" style="width: 989px;"><img src="https://us.v-cdn.net/6038925/uploads/images/74791i98CF0F2C6E15C248/Craige_Hales_2-1744505945837.png" role="button" title="Craige_Hales_2-1744505945837.png" alt="Craige_Hales_2-1744505945837.png" /></span></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></P>
<P><A href="https://drill.apache.org/docs/rest-api-introduction/#query" target="_blank" rel="nofollow noopener noreferrer">https://drill.apache.org/docs/rest-api-introduction/#query가 API에 도움이 될 수 있습니다.</A></P>
<BR />
<P>이것에 대해 너무 많은 것을 말하기 전에 흥미로운 글을 읽어보세요:</P>
<P><A href="https://www.starburst.io/blog/the-death-of-apache-drill/" target="_blank" rel="noopener nofollow noreferrer">https://www.starburst.io/blog/the-death-of-apache-drill/</A></P>
<P><A href="https://stackoverflow.com/questions/59754457/mapr-driver-discontinued-for-apache-drill-what-now" target="_blank" rel="noopener nofollow noreferrer">https://stackoverflow.com/questions/59754457/mapr-driver-discontinued-for-apache-drill-what-now</A></P>
<P>하지만 아직도 활동이 있습니다.</P>
<P><A href="https://github.com/apache/drill" target="_blank" rel="noopener nofollow noreferrer">https://github.com/apache/drill</A></P>
<BR />JMP EA 버전은 어디서 사용해 볼 수 있나요? 제 Parquet에는 열이 너무 많아서 각각을 명시적으로 정의할 수 없는데, from_dataframe()을 사용하는 게 정말 매력적이네요.
저는 grok3 방법을 너무 느리게 사용합니다

JMP 영업팀에 문의하세요. 얼리 어답터 프로그램이 있습니다. MyJMP 포털을 통해 JMP 18에 접속할 수 있다면 얼리 어답터 릴리스도 이용할 수 있을 것 같습니다. 하지만 추가적인 비공개 양식/단계가 있을 수 있습니다.