Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect precision and scale from DatabaseMetaData.getColumns #815

Merged
merged 6 commits into from
Jan 25, 2022
Merged

Fix incorrect precision and scale from DatabaseMetaData.getColumns #815

merged 6 commits into from
Jan 25, 2022

Conversation

zhicwu
Copy link
Contributor

@zhicwu zhicwu commented Jan 18, 2022

  • merge Fix wrong precision #808 to fix wrong precision
  • return scale for number, date, and date time
  • ClickHouseDataType.Enum is deprecated and it will be removed in 0.3.3 - it's just an alias of Enum8
  • support binary string with ~10% performance penalty
  • bump vesion to 0.3.2-patch3

@zhicwu zhicwu linked an issue Jan 18, 2022 that may be closed by this pull request
@github-actions
Copy link

Benchmark                                 (client)  (connection)  (statement)  (type)   Mode  Cnt     Score     Error  Units
Basic.insertOneRandomNumber  clickhouse-http-jdbc1         reuse       normal  object  thrpt   20   193.678 ±  29.140  ops/s
Basic.insertOneRandomNumber  clickhouse-http-jdbc1         reuse     prepared  object  thrpt   20   192.636 ±  26.494  ops/s
Basic.insertOneRandomNumber  clickhouse-http-jdbc1           new       normal  object  thrpt   20   183.383 ±  28.377  ops/s
Basic.insertOneRandomNumber  clickhouse-http-jdbc1           new     prepared  object  thrpt   20   181.711 ±  23.816  ops/s
Basic.insertOneRandomNumber   clickhouse-grpc-jdbc         reuse       normal  object  thrpt   20   198.096 ±  20.418  ops/s
Basic.insertOneRandomNumber   clickhouse-grpc-jdbc         reuse     prepared  object  thrpt   20   203.571 ±  23.534  ops/s
Basic.insertOneRandomNumber   clickhouse-grpc-jdbc           new       normal  object  thrpt   20   203.532 ±  21.148  ops/s
Basic.insertOneRandomNumber   clickhouse-grpc-jdbc           new     prepared  object  thrpt   20   202.949 ±  24.315  ops/s
Basic.selectOneRandomNumber  clickhouse-http-jdbc1         reuse       normal  object  thrpt   20  1288.791 ±  92.188  ops/s
Basic.selectOneRandomNumber  clickhouse-http-jdbc1         reuse     prepared  object  thrpt   20  1337.729 ± 103.986  ops/s
Basic.selectOneRandomNumber  clickhouse-http-jdbc1           new       normal  object  thrpt   20  1359.161 ±  84.250  ops/s
Basic.selectOneRandomNumber  clickhouse-http-jdbc1           new     prepared  object  thrpt   20  1355.471 ±  95.851  ops/s
Basic.selectOneRandomNumber   clickhouse-grpc-jdbc         reuse       normal  object  thrpt   20   753.666 ±  75.324  ops/s
Basic.selectOneRandomNumber   clickhouse-grpc-jdbc         reuse     prepared  object  thrpt   20   784.465 ±  63.581  ops/s
Basic.selectOneRandomNumber   clickhouse-grpc-jdbc           new       normal  object  thrpt   20   740.237 ±  70.331  ops/s
Basic.selectOneRandomNumber   clickhouse-grpc-jdbc           new     prepared  object  thrpt   20   812.281 ±  71.306  ops/s

@github-actions
Copy link

Benchmark                                 (client)  (connection)  (statement)  (type)   Mode  Cnt     Score     Error  Units
Basic.insertOneRandomNumber  clickhouse-http-jdbc1         reuse       normal  object  thrpt   20   245.745 ±  29.659  ops/s
Basic.insertOneRandomNumber  clickhouse-http-jdbc1         reuse     prepared  object  thrpt   20   240.475 ±  27.893  ops/s
Basic.insertOneRandomNumber  clickhouse-http-jdbc1           new       normal  object  thrpt   20   234.044 ±  26.394  ops/s
Basic.insertOneRandomNumber  clickhouse-http-jdbc1           new     prepared  object  thrpt   20   236.712 ±  27.225  ops/s
Basic.insertOneRandomNumber   clickhouse-grpc-jdbc         reuse       normal  object  thrpt   20   249.089 ±  27.388  ops/s
Basic.insertOneRandomNumber   clickhouse-grpc-jdbc         reuse     prepared  object  thrpt   20   245.005 ±  30.778  ops/s
Basic.insertOneRandomNumber   clickhouse-grpc-jdbc           new       normal  object  thrpt   20   245.756 ±  31.402  ops/s
Basic.insertOneRandomNumber   clickhouse-grpc-jdbc           new     prepared  object  thrpt   20   248.149 ±  29.636  ops/s
Basic.selectOneRandomNumber  clickhouse-http-jdbc1         reuse       normal  object  thrpt   20  1733.389 ±  76.214  ops/s
Basic.selectOneRandomNumber  clickhouse-http-jdbc1         reuse     prepared  object  thrpt   20  1724.890 ± 108.096  ops/s
Basic.selectOneRandomNumber  clickhouse-http-jdbc1           new       normal  object  thrpt   20  1720.489 ±  71.368  ops/s
Basic.selectOneRandomNumber  clickhouse-http-jdbc1           new     prepared  object  thrpt   20  1670.559 ±  83.886  ops/s
Basic.selectOneRandomNumber   clickhouse-grpc-jdbc         reuse       normal  object  thrpt   20  1039.308 ± 102.320  ops/s
Basic.selectOneRandomNumber   clickhouse-grpc-jdbc         reuse     prepared  object  thrpt   20  1071.315 ±  78.335  ops/s
Basic.selectOneRandomNumber   clickhouse-grpc-jdbc           new       normal  object  thrpt   20  1051.669 ± 108.308  ops/s
Basic.selectOneRandomNumber   clickhouse-grpc-jdbc           new     prepared  object  thrpt   20  1065.422 ±  95.614  ops/s

@github-actions
Copy link

Benchmark                                 (client)  (connection)  (statement)  (type)   Mode  Cnt     Score    Error  Units
Basic.insertOneRandomNumber  clickhouse-http-jdbc1         reuse       normal  object  thrpt   20   217.135 ± 24.882  ops/s
Basic.insertOneRandomNumber  clickhouse-http-jdbc1         reuse     prepared  object  thrpt   20   214.405 ± 23.925  ops/s
Basic.insertOneRandomNumber  clickhouse-http-jdbc1           new       normal  object  thrpt   20   211.479 ± 24.566  ops/s
Basic.insertOneRandomNumber  clickhouse-http-jdbc1           new     prepared  object  thrpt   20   211.611 ± 24.408  ops/s
Basic.insertOneRandomNumber   clickhouse-grpc-jdbc         reuse       normal  object  thrpt   20   221.481 ± 26.230  ops/s
Basic.insertOneRandomNumber   clickhouse-grpc-jdbc         reuse     prepared  object  thrpt   20   221.004 ± 23.488  ops/s
Basic.insertOneRandomNumber   clickhouse-grpc-jdbc           new       normal  object  thrpt   20   219.897 ± 27.486  ops/s
Basic.insertOneRandomNumber   clickhouse-grpc-jdbc           new     prepared  object  thrpt   20   220.436 ± 24.626  ops/s
Basic.selectOneRandomNumber  clickhouse-http-jdbc1         reuse       normal  object  thrpt   20  1138.247 ± 76.268  ops/s
Basic.selectOneRandomNumber  clickhouse-http-jdbc1         reuse     prepared  object  thrpt   20  1163.688 ± 76.778  ops/s
Basic.selectOneRandomNumber  clickhouse-http-jdbc1           new       normal  object  thrpt   20  1154.751 ± 72.665  ops/s
Basic.selectOneRandomNumber  clickhouse-http-jdbc1           new     prepared  object  thrpt   20  1161.451 ± 71.412  ops/s
Basic.selectOneRandomNumber   clickhouse-grpc-jdbc         reuse       normal  object  thrpt   20   767.945 ± 67.073  ops/s
Basic.selectOneRandomNumber   clickhouse-grpc-jdbc         reuse     prepared  object  thrpt   20   722.231 ± 68.789  ops/s
Basic.selectOneRandomNumber   clickhouse-grpc-jdbc           new       normal  object  thrpt   20   692.601 ± 73.922  ops/s
Basic.selectOneRandomNumber   clickhouse-grpc-jdbc           new     prepared  object  thrpt   20   744.940 ± 72.053  ops/s

@github-actions
Copy link

Benchmark                                 (client)  (connection)  (statement)  (type)   Mode  Cnt     Score    Error  Units
Basic.insertOneRandomNumber  clickhouse-http-jdbc1         reuse       normal  object  thrpt   20   202.264 ± 26.945  ops/s
Basic.insertOneRandomNumber  clickhouse-http-jdbc1         reuse     prepared  object  thrpt   20   204.332 ± 23.302  ops/s
Basic.insertOneRandomNumber  clickhouse-http-jdbc1           new       normal  object  thrpt   20   202.734 ± 25.405  ops/s
Basic.insertOneRandomNumber  clickhouse-http-jdbc1           new     prepared  object  thrpt   20   199.963 ± 19.288  ops/s
Basic.insertOneRandomNumber   clickhouse-grpc-jdbc         reuse       normal  object  thrpt   20   213.427 ± 22.393  ops/s
Basic.insertOneRandomNumber   clickhouse-grpc-jdbc         reuse     prepared  object  thrpt   20   214.013 ± 25.676  ops/s
Basic.insertOneRandomNumber   clickhouse-grpc-jdbc           new       normal  object  thrpt   20   214.345 ± 21.810  ops/s
Basic.insertOneRandomNumber   clickhouse-grpc-jdbc           new     prepared  object  thrpt   20   213.697 ± 22.001  ops/s
Basic.selectOneRandomNumber  clickhouse-http-jdbc1         reuse       normal  object  thrpt   20   977.250 ± 91.997  ops/s
Basic.selectOneRandomNumber  clickhouse-http-jdbc1         reuse     prepared  object  thrpt   20  1065.860 ± 92.370  ops/s
Basic.selectOneRandomNumber  clickhouse-http-jdbc1           new       normal  object  thrpt   20  1057.310 ± 74.606  ops/s
Basic.selectOneRandomNumber  clickhouse-http-jdbc1           new     prepared  object  thrpt   20  1085.863 ± 65.352  ops/s
Basic.selectOneRandomNumber   clickhouse-grpc-jdbc         reuse       normal  object  thrpt   20   653.939 ± 63.630  ops/s
Basic.selectOneRandomNumber   clickhouse-grpc-jdbc         reuse     prepared  object  thrpt   20   666.009 ± 60.259  ops/s
Basic.selectOneRandomNumber   clickhouse-grpc-jdbc           new       normal  object  thrpt   20   640.981 ± 62.987  ops/s
Basic.selectOneRandomNumber   clickhouse-grpc-jdbc           new     prepared  object  thrpt   20   677.950 ± 61.554  ops/s

@tangjiangling
Copy link

@zhicwu Do you mind if i merge all the fixes into this #808?

@tangjiangling
Copy link

@zhicwu Do you mind if i merge all the fixes into this #808?

Or is this already all the fixes? No longer need to have #808.

@zhicwu
Copy link
Contributor Author

zhicwu commented Jan 25, 2022

Or is this already all the fixes? No longer need to have #808.

Thanks for checking @tangjiangling. This pull request contains all the fixes. I think it's safe to close #808, if that's ok for you. Apart from that, I'll commit a few more lines tonight to fix ClickHouseStringValue.hashCode() and maybe the performance penalty(-10%).

@zhicwu zhicwu changed the title Fix incorrect precision returnede from DatabaseMetaData.getColumns Fix incorrect precision and scale from DatabaseMetaData.getColumns Jan 25, 2022
@github-actions
Copy link

Benchmark                                 (client)  (connection)  (statement)  (type)   Mode  Cnt     Score    Error  Units
Basic.insertOneRandomNumber  clickhouse-http-jdbc1         reuse       normal  object  thrpt   20   229.341 ± 30.604  ops/s
Basic.insertOneRandomNumber  clickhouse-http-jdbc1         reuse     prepared  object  thrpt   20   223.563 ± 24.223  ops/s
Basic.insertOneRandomNumber  clickhouse-http-jdbc1           new       normal  object  thrpt   20   223.763 ± 23.694  ops/s
Basic.insertOneRandomNumber  clickhouse-http-jdbc1           new     prepared  object  thrpt   20   224.300 ± 24.856  ops/s
Basic.insertOneRandomNumber   clickhouse-grpc-jdbc         reuse       normal  object  thrpt   20   236.026 ± 26.393  ops/s
Basic.insertOneRandomNumber   clickhouse-grpc-jdbc         reuse     prepared  object  thrpt   20   238.267 ± 24.880  ops/s
Basic.insertOneRandomNumber   clickhouse-grpc-jdbc           new       normal  object  thrpt   20   231.466 ± 24.626  ops/s
Basic.insertOneRandomNumber   clickhouse-grpc-jdbc           new     prepared  object  thrpt   20   238.261 ± 27.944  ops/s
Basic.selectOneRandomNumber  clickhouse-http-jdbc1         reuse       normal  object  thrpt   20  1273.916 ± 87.640  ops/s
Basic.selectOneRandomNumber  clickhouse-http-jdbc1         reuse     prepared  object  thrpt   20  1344.197 ± 91.589  ops/s
Basic.selectOneRandomNumber  clickhouse-http-jdbc1           new       normal  object  thrpt   20  1344.295 ± 72.488  ops/s
Basic.selectOneRandomNumber  clickhouse-http-jdbc1           new     prepared  object  thrpt   20  1323.718 ± 64.596  ops/s
Basic.selectOneRandomNumber   clickhouse-grpc-jdbc         reuse       normal  object  thrpt   20   926.808 ± 59.384  ops/s
Basic.selectOneRandomNumber   clickhouse-grpc-jdbc         reuse     prepared  object  thrpt   20   856.081 ± 61.271  ops/s
Basic.selectOneRandomNumber   clickhouse-grpc-jdbc           new       normal  object  thrpt   20   886.007 ± 72.974  ops/s
Basic.selectOneRandomNumber   clickhouse-grpc-jdbc           new     prepared  object  thrpt   20   891.523 ± 62.431  ops/s

@github-actions
Copy link

Benchmark                                 (client)  (connection)  (statement)  (type)   Mode  Cnt     Score     Error  Units
Basic.insertOneRandomNumber  clickhouse-http-jdbc1         reuse       normal  object  thrpt   20   229.484 ±  32.889  ops/s
Basic.insertOneRandomNumber  clickhouse-http-jdbc1         reuse     prepared  object  thrpt   20   234.050 ±  30.077  ops/s
Basic.insertOneRandomNumber  clickhouse-http-jdbc1           new       normal  object  thrpt   20   214.545 ±  39.640  ops/s
Basic.insertOneRandomNumber  clickhouse-http-jdbc1           new     prepared  object  thrpt   20   215.086 ±  31.611  ops/s
Basic.insertOneRandomNumber   clickhouse-grpc-jdbc         reuse       normal  object  thrpt   20   228.890 ±  28.501  ops/s
Basic.insertOneRandomNumber   clickhouse-grpc-jdbc         reuse     prepared  object  thrpt   20   236.223 ±  28.689  ops/s
Basic.insertOneRandomNumber   clickhouse-grpc-jdbc           new       normal  object  thrpt   20   201.262 ±  26.862  ops/s
Basic.insertOneRandomNumber   clickhouse-grpc-jdbc           new     prepared  object  thrpt   20   216.987 ±  35.516  ops/s
Basic.selectOneRandomNumber  clickhouse-http-jdbc1         reuse       normal  object  thrpt   20  1563.995 ± 148.159  ops/s
Basic.selectOneRandomNumber  clickhouse-http-jdbc1         reuse     prepared  object  thrpt   20  1633.013 ± 115.324  ops/s
Basic.selectOneRandomNumber  clickhouse-http-jdbc1           new       normal  object  thrpt   20  1614.855 ± 112.903  ops/s
Basic.selectOneRandomNumber  clickhouse-http-jdbc1           new     prepared  object  thrpt   20  1617.748 ±  86.115  ops/s
Basic.selectOneRandomNumber   clickhouse-grpc-jdbc         reuse       normal  object  thrpt   20  1005.226 ±  85.361  ops/s
Basic.selectOneRandomNumber   clickhouse-grpc-jdbc         reuse     prepared  object  thrpt   20  1028.723 ±  76.903  ops/s
Basic.selectOneRandomNumber   clickhouse-grpc-jdbc           new       normal  object  thrpt   20   996.925 ± 116.411  ops/s
Basic.selectOneRandomNumber   clickhouse-grpc-jdbc           new     prepared  object  thrpt   20   928.755 ± 127.765  ops/s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New Driver returns incorrect precision
2 participants