* @package bi * @version $Id$ * @link https://www.zentao.net */ class bi extends control { /** * 使用 duckDB 生成最新的 parquet 文件。 * Use duckDB gen lastest parquet. * * @access public * @return void */ public function syncParquetFile() { $startTime = microtime(true); $duckdb = $this->bi->getDuckDBPath(); if(!$duckdb) { echo("DuckDB bin path not exists."); return; } $duckdbTmpPath = $this->bi->getDuckDBTmpDir(); if(!$duckdbTmpPath) { echo("Create DuckDB tmp dir permission denied."); return; } $copySQL = $this->bi->prepareCopySQL($duckdbTmpPath); $command = $this->bi->prepareSyncCommand($duckdb->bin, $duckdb->extension, $copySQL); $output = shell_exec($command); $endTime = microtime(true); $runTime = $endTime - $startTime; echo "$runTime \n"; if(empty($output)) { echo('success'); return; } echo($output); } /** * Ajax: get object options. * * @access public * @return void */ public function ajaxGetScopeOptions($type) { $scopeOptions = $this->bi->getScopeOptions($type); $items = array(); foreach($scopeOptions as $key => $option) $items[] = array('text' => $option, 'value' => $key, 'keys' => $option); return print(json_encode($items)); } }