【问题标题】:Clickhouse: larger files seem to be kicking a buffer and diagnostic issue?Clickhouse:较大的文件似乎正在引发缓冲区和诊断问题?
【发布时间】:2019-12-18 15:49:18
【问题描述】:

我正在使用 windows docker desktop 10 上的 clickhouse docker 映像:

https://hub.docker.com/r/yandex/clickhouse-server/

我已启动并运行容器并正在加载数据。我遇到了这个问题,CH 抱怨在 xyz 行之前需要一个逗号,但是在记事本 ++ 中打开文件后,我知道一个事实,实际上它应该是一个逗号:

Code: 27. DB::Exception: Cannot parse input: expected , before . . . 

或者会有关于行尾的问题:

Code: 117. DB::Exception: Expected end of line: (at row 127249)

它也抱怨:

Could not print diagnostic info because two last rows aren't in buffer (rare case)

我注意到对于相对较小的文件我没有问题(少于 30k 行)。但是较大的文件是一个问题。我之前测试过这些文件,所以我知道它们很好并且可以加载。这似乎是图像中 clickhouse 的问题,因为它甚至无法打印出诊断。任何想法可能是什么问题?

编辑:示例

下面的这些数据我得到了上面提到的错误之一。我使用 R 编写了一个 1000,000 行的文件来加载:

#generate my data-----------------------------------------------------------
library(data.table)
set.seed(22)
u = runif(1000000, 0, 60) # "noise" to add or subtract from some timepoint
x = runif(1000000, 0, 1)

my_table = 
data.table(
  pudt=as.POSIXct(u, origin = "2017-02-03 08:00:00"),
  count = round(x,2)
)

my_table[
  ,pudt:=as.character(pudt)]

#write out--------------------------------------
fwrite(my_table, "my_data.csv", row.names = F, col.names = F)


#create my table in clickhouse client 
CREATE TABLE test(
  pudt DateTime,
  count Float32
)engine = Log;


#load the data in powershell-----
$files = Get-ChildItem "where my files are . . . "

foreach ($f in $files){
  $outfile = $f.FullName | Write-Host
  Get-Date | Write-Host    
  "Start loading" + $f.FullName | Write-Host
  `cat $f.FullName | docker run -i --rm --link some-clickhouse-server:clickhouse-client yandex/clickhouse-client -m --host some-clickhouse-server --query="INSERT INTO test FORMAT CSV"`
  "End loading" + $f.FullName | Write-Host
  [GC]::Collect()
}

我在这里遇到的错误是:

    Code: 117. DB::Exception: Expected end of line: (at row 144020)
Could not print diagnostic info because two last rows aren't in buffer (rare case)

我检查了文件,并没有发现我知道的问题:

【问题讨论】:

标签: r windows docker clickhouse


【解决方案1】:

看来这是CH官方的bug,我去测试看看:

https://groups.google.com/forum/#!topic/clickhouse/Ofbtz5B7_Fw

更新:

通过在 13.9 上构建自定义 clickhouse-client 映像解决了该问题。现在完美运行。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-08-16
    • 2016-01-31
    • 1970-01-01
    相关资源
    最近更新 更多