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

Unknown data type: IPv6 #430

Closed
Tiakon opened this issue Nov 22, 2022 · 1 comment
Closed

Unknown data type: IPv6 #430

Tiakon opened this issue Nov 22, 2022 · 1 comment
Assignees

Comments

@Tiakon
Copy link

Tiakon commented Nov 22, 2022

Environment

  • OS version: win7
  • JDK version:jdk1.8.0_191
  • ClickHouse Server version: 21.8.9.13 (official build).
  • ClickHouse Native JDBC version:2.6.5

Error logs

com.github.housepower.exception.ClickHouseSQLException: Unknown data type: IPv6

	at com.github.housepower.misc.ExceptionUtil.rethrowSQLException(ExceptionUtil.java:70)
	at com.github.housepower.jdbc.statement.ClickHousePreparedInsertStatement.initBlockIfPossible(ClickHousePreparedInsertStatement.java:207)
	at com.github.housepower.jdbc.statement.ClickHousePreparedInsertStatement.<init>(ClickHousePreparedInsertStatement.java:111)
	at com.github.housepower.jdbc.ClickHouseConnection.prepareStatement(ClickHouseConnection.java:170)
	at com.ngaa.bigdata.util.clickhouse.ClickHouseTcpJavaClientTest.batchInsertToPCdnDBHostDataLocal(ClickHouseTcpJavaClientTest.java:226)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)
	at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)
	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235)
	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)
Caused by: java.sql.SQLException: Unknown data type: IPv6
	at com.github.housepower.misc.Validate.isTrue(Validate.java:41)
	at com.github.housepower.data.DataTypeFactory.get(DataTypeFactory.java:104)
	at com.github.housepower.data.DataTypeFactory.get(DataTypeFactory.java:66)
	at com.github.housepower.data.Block.readFrom(Block.java:43)
	at com.github.housepower.protocol.DataResponse.readFrom(DataResponse.java:32)
	at com.github.housepower.protocol.Response.readFrom(Response.java:33)
	at com.github.housepower.client.NativeClient.receiveResponse(NativeClient.java:183)
	at com.github.housepower.client.NativeClient.receiveSampleBlock(NativeClient.java:106)
	at com.github.housepower.jdbc.ClickHouseConnection.getSampleBlock(ClickHouseConnection.java:275)
	at com.github.housepower.jdbc.statement.ClickHousePreparedInsertStatement.lambda$initBlockIfPossible$0(ClickHousePreparedInsertStatement.java:208)
	at com.github.housepower.misc.ExceptionUtil.rethrowSQLException(ExceptionUtil.java:64)
	... 32 more

Steps to reproduce

sql CREATE TABLE hits (url String, from IPv6) ENGINE = MergeTree() ORDER BY url;

    pstmt.setString(2, "2a02:aa08:e000:3100::2");

An exception occurs when IPv6 data is inserted into the jdbc code because the field in the table is of ipv6 type.

Other descriptions

When the fields in my table are of type ipv6, I don't know which type to insert. Is it because the current ClickHouse Native JDBC does not support IPV6?
If I use the wrong data type, please tell me which data type should be used, I will be very grateful.

@tongle1
Copy link

tongle1 commented Jan 13, 2023

现在的java版本客户端还没支持IPv6,C++的是支持的。

@demetribu demetribu self-assigned this Sep 26, 2023
demetribu added a commit that referenced this issue Oct 8, 2023
demetribu added a commit that referenced this issue Oct 8, 2023
sundy-li pushed a commit that referenced this issue Oct 9, 2023
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

No branches or pull requests

3 participants