如何从HIVE表中选择并使用分隔符分隔列?

时间:2015-01-16 20:57:58

标签: php hive

平,

我有一张桌子'文件'我想知道是否可以从这个表中选择并用';'分隔每一列?

$sqlSearchByString = "SELECT fileName as name, description, dimension
                      FROM {$tableName}
                      WHERE fileName LIKE '%{$searchedWord}%'
                      OR description LIKE '%{$searchedWord}%'";

$this->client->execute($sqlSearchByString);
$result = $this->client->fetchAll();

1 个答案:

答案 0 :(得分:0)

文档很糟糕,或者我只是看不到列出方法的位置,但这应该是正确的方法:

foreach($this->client->fetchAll() as $row) {
    $result[] = implode(';', $row);
}