/* parqit describe - Describe and explore a view or a Parquet file *! VERSION 0.1.37 07sep2026 User > parqit > Describe and explore data... Launch directly with: db parqit_explore (menu installed by: parqit menu) One list box of operations (Stata's interface guideline for more than about twelve choices), each an engine-side query that leaves the data in memory unchanged: describe/glimpse, ds, lookfor, codebook, head, list, count, misstable [patterns], levelsof, distinct, duplicates report/list. Summary statistics live in the companion dialog: db parqit_stats */ VERSION 16.0 INCLUDE _std_wide DEFINE _dlght 400 INCLUDE header HELP hlp1, view("help parqit##explore") RESET res1 SCRIPT PREINIT BEGIN create STRING dlgname dlgname.storeDialogClassName create DOUBLE pq_populate_error main.fi_file.formatfilter /// "Parquet (*.parquet)|*.parquet|" /// "All files (*.*)|*.*" END PROGRAM POSTINIT_PROGRAM BEGIN call main.lb_op.forceselchange call program main_context END DIALOG main, label("parqit describe - Describe and explore a view or a Parquet file") /// tabtitle("Main") BEGIN TEXT tx_op _lft _top 250 ., /// label("Operation:") LISTBOX lb_op _lft _ss 250 300, /// contents(op_words) /// values(op_vals) /// onselchangelist(op_change) /// label("Operation") TEXT tx_file 275 _top 315 ., /// label("Parquet file, glob, or Hive directory:") FILE fi_file 275 _ss 315 ., /// error("Filename") /// defext(parquet) /// label("Browse...") TEXT tx_vars 275 _ls 230 ., /// label("Variables (leave empty for all):") BUTTON bu_pop 510 @ 80 ., /// onpush(program main_populate) /// tooltip("Populate combobox with the variable names of the current view") /// label("Populate") COMBOBOX cb_vars 275 _ss 315 ., /// append /// dropdown /// contents(vv_list) /// label("Variables") TEXT tx_if 275 _ls 315 ., /// label("If (expression):") EXP ex_if 275 _ss 315 ., /// label("Create...") TEXT tx_rows 275 _ls 60 ., /// label("Rows:") right EDIT ed_rows 340 @ 60 ., /// numonly /// default(5) /// label("Rows") TEXT tx_limit 405 @ 60 ., /// label("Limit:") right EDIT ed_limit 470 @ 60 ., /// numonly /// option(limit) /// label("Limit") TEXT tx_from 275 _ls 60 ., /// label("From:") right EDIT ed_from 340 @ 60 ., /// numonly /// label("From") TEXT tx_to 405 @ 60 ., /// label("to:") right EDIT ed_to 470 @ 60 ., /// numonly /// label("to") CHECKBOX ck_joint 275 _ls 315 ., /// option(joint) /// label("Also count the distinct joint values (joint)") TEXT tx_note 275 _ls 315 ., /// label("Engine-side query; the data in memory are unchanged.") TEXT tx_context _lft 355 470 ., label("Current view: refresh to check") BUTTON bu_context _rj80 @ 80 ., label("Refresh") onpush(program main_populate) END LIST vv_list BEGIN END LIST op_words BEGIN Describe the current view Describe a Parquet file (footer only) Glimpse the view or a Parquet file List variable names (ds) Search names and labels (lookfor) Codebook Preview the first rows (head) List observations (list) Count observations (count) Missing values by variable (misstable) Missing patterns (misstable patterns) Levels of one variable (levelsof) Distinct values (distinct) Report duplicates (duplicates report) List duplicates (duplicates list) END LIST op_vals BEGIN descview descfile glimpse ds lookfor codebook head list count misstable misspatterns levelsof distinct dupreport duplist END LIST op_change BEGIN script op_descview script op_descfile script op_glimpse script op_descview script op_lookfor script op_vars script op_head script op_list script op_count script op_vars script op_patterns script op_levelsof script op_distinct script op_keys script op_keys END SCRIPT all_off BEGIN main.tx_file.disable main.fi_file.disable main.tx_vars.disable main.bu_pop.disable main.cb_vars.disable main.tx_if.disable main.ex_if.disable main.tx_rows.disable main.ed_rows.disable main.tx_limit.disable main.ed_limit.disable main.tx_from.disable main.ed_from.disable main.tx_to.disable main.ed_to.disable main.ck_joint.disable main.tx_vars.setlabel "Variables (leave empty for all):" main.tx_file.setlabel "Parquet file, glob, or Hive directory:" END SCRIPT vars_on BEGIN main.tx_vars.enable main.bu_pop.enable main.cb_vars.enable END SCRIPT op_descview BEGIN script all_off END SCRIPT op_descfile BEGIN script all_off main.tx_file.enable main.fi_file.enable END SCRIPT op_glimpse BEGIN script all_off main.tx_file.enable main.fi_file.enable main.tx_file.setlabel "Parquet file, glob, or Hive directory (leave empty for the current view):" END SCRIPT op_lookfor BEGIN script all_off script vars_on main.tx_vars.setlabel "Words to search for in variable names and labels:" END SCRIPT op_vars BEGIN script all_off script vars_on END SCRIPT op_patterns BEGIN script all_off script vars_on main.tx_vars.setlabel "Variables (maximum 14; empty selects all):" END SCRIPT op_head BEGIN script all_off main.tx_rows.enable main.ed_rows.enable END SCRIPT op_list BEGIN script all_off script vars_on main.tx_if.enable main.ex_if.enable main.tx_from.enable main.ed_from.enable main.tx_to.enable main.ed_to.enable END SCRIPT op_count BEGIN script all_off main.tx_if.enable main.ex_if.enable END SCRIPT op_levelsof BEGIN script all_off script vars_on main.tx_vars.setlabel "Variable:" main.tx_limit.enable main.ed_limit.enable END SCRIPT op_distinct BEGIN script all_off script vars_on main.ck_joint.enable END SCRIPT op_keys BEGIN script all_off script vars_on main.tx_vars.setlabel "Key variables:" main.tx_limit.enable main.ed_limit.enable END PROGRAM main_populate BEGIN call program main_context call pq_populate_error.setvalue 0 put "parqit _dlgvars " put dlgname put " vv_list" stata hidden immediate if pq_populate_error { stopbox stop "Unable to get the variable names of the current view." /// "Open a view first (User > parqit > Read data...)." } call main.cb_vars.repopulate END PROGRAM main_context BEGIN put "parqit _dlgcontext " put dlgname stata hidden queue clear END PROGRAM command BEGIN if main.lb_op.equals("descview") { put "parqit describe" } if main.lb_op.equals("descfile") { require main.fi_file put "parqit describe " put /smartquote main.fi_file } if main.lb_op.equals("glimpse") { put "parqit glimpse" if main.fi_file { put " " put /smartquote main.fi_file } } if main.lb_op.equals("ds") { put "parqit ds" } if main.lb_op.equals("lookfor") { require main.cb_vars put "parqit lookfor " main.cb_vars } if main.lb_op.equals("codebook") { put "parqit codebook" if main.cb_vars { put " " main.cb_vars } } if main.lb_op.equals("head") { require main.ed_rows put "parqit head " main.ed_rows } if main.lb_op.equals("list") { put "parqit list" if main.cb_vars { put " " main.cb_vars } if main.ex_if { put " if " main.ex_if } if main.ed_from | main.ed_to { require main.ed_from require main.ed_to put " in " main.ed_from "/" main.ed_to } } if main.lb_op.equals("count") { put "parqit count" if main.ex_if { put " if " main.ex_if } } if main.lb_op.equals("misstable") { put "parqit misstable" if main.cb_vars { put " " main.cb_vars } } if main.lb_op.equals("misspatterns") { put "parqit misstable patterns" if main.cb_vars { put " " main.cb_vars } } if main.lb_op.equals("levelsof") { require main.cb_vars put "parqit levelsof " main.cb_vars beginoptions optionarg main.ed_limit endoptions } if main.lb_op.equals("distinct") { put "parqit distinct" if main.cb_vars { put " " main.cb_vars } beginoptions option main.ck_joint endoptions } if main.lb_op.equals("dupreport") { require main.cb_vars put "parqit duplicates report " main.cb_vars beginoptions optionarg main.ed_limit endoptions } if main.lb_op.equals("duplist") { require main.cb_vars put "parqit duplicates list " main.cb_vars beginoptions optionarg main.ed_limit endoptions } END