taosdata / TDengine

High-performance, scalable time-series database designed for Industrial IoT (IIoT) scenarios
https://tdengine.com
GNU Affero General Public License v3.0
23.39k stars 4.86k forks source link

schemaless line protocal writting issue #18049

Closed YANGQINZ closed 2 years ago

YANGQINZ commented 2 years ago

版本3.0.1.5,集群 java驱动版本3.0.2 使用influxdb schemaless line 测试数据:S_root_1589790298655502338_127_0_0_1_102_ZJDYCPSS2_V28,tname=Z_root_1589790298655502338_127_0_0_1_102_ZJDYCPSS2_V28,location=root_1589790298655502338_127_0_0_1_102_ZJDYCPSS2_V28,groupid=1 Z_aciGGIO1_AnIn1_mag_f=0.0,Z_aciGGIO1_AnIn2_mag_f=0.0,Z_aciGGIO1_AnIn3_mag_f=0.0,Z_aciGGIO2_AnIn1_mag_f=0.0,Z_aciGGIO2_AnIn2_mag_f=0.0,Z_aciGGIO2_AnIn3_mag_f=0.0,Z_acbGGIO1_AnIn1_mag_f=0.0,Z_acbGGIO1_AnIn2_mag_f=0.0,Z_acbGGIO1_AnIn3_mag_f=0.0,Z_acbGGIO1_AnIn4_mag_f=0.0,Z_acbGGIO1_AnIn5_mag_f=0.0,Z_acbGGIO1_AnIn6_mag_f=0.0,Z_dbmGGIO1_AnIn1_mag_f=0.0,Z_dbmGGIO1_AnIn2_mag_f=0.0,Z_btgGGIO1_AnIn2_mag_f=0.0,Z_cheGGIO1_AnIn4_mag_f=0.0,Z_cheGGIO1_AnIn2_mag_f=0.0,Z_cheGGIO1_AnIn3_mag_f=0.0,Z_btgGGIO1_AnIn1_mag_f=0.0,Z_btgGGIO2_AnIn1_mag_f=0.0,Z_etmGGIO1_AnIn1_mag_f=0.0,Z_chmGGIO1_AnIn1_mag_f=0.0,Z_chmGGIO2_AnIn1_mag_f=0.0,Z_chmGGIO3_AnIn1_mag_f=0.0,Z_chmGGIO4_AnIn1_mag_f=0.0,Z_chmGGIO5_AnIn1_mag_f=0.0,Z_chmGGIO6_AnIn1_mag_f=0.0,Z_chmGGIO7_AnIn1_mag_f=0.0,Z_chmGGIO8_AnIn1_mag_f=0.0,Z_chmGGIO9_AnIn1_mag_f=0.0,Z_chmGGIO10_AnIn1_mag_f=0.0,Z_chmGGIO11_AnIn1_mag_f=0.0,Z_chmGGIO12_AnIn1_mag_f=0.0,Z_chmGGIO13_AnIn1_mag_f=0.0,Z_chmGGIO14_AnIn1_mag_f=0.0,Z_chmGGIO15_AnIn1_mag_f=0.0,Z_chmGGIO16_AnIn1_mag_f=0.0,Z_chmGGIO17_AnIn1_mag_f=0.0,Z_chmGGIO18_AnIn1_mag_f=0.0,Z_chmGGIO19_AnIn1_mag_f=0.0,Z_chmGGIO20_AnIn1_mag_f=0.0,Z_aciGGIO1_AnIn7_mag_f=0.0,Z_aciGGIO1_AnIn8_mag_f=0.0,Z_dbmGGIO1_AnIn3_mag_f=0.0,Z_dbmGGIO1_AnIn4_mag_f=0.0,Z_aciGGIO1_Ind10_stVal=false,Z_aciGGIO2_Ind10_stVal=false,Z_aciGGIO1_Ind11_stVal=false,Z_aciGGIO2_Ind11_stVal=false,Z_gswGGIO1_Alm_stVal=false,Z_gswGGIO2_Alm_stVal=false,Z_aciGGIO1_Ind1_stVal=false,Z_aciGGIO1_Ind2_stVal=false,Z_aciGGIO1_Ind4_stVal=false,Z_aciGGIO1_Ind5_stVal=false,Z_aciGGIO1_Ind7_stVal=false,Z_aciGGIO1_Ind8_stVal=false,Z_aciGGIO2_Ind1_stVal=false,Z_aciGGIO2_Ind2_stVal=false,Z_aciGGIO2_Ind4_stVal=false,Z_aciGGIO2_Ind5_stVal=false,Z_aciGGIO2_Ind7_stVal=false,Z_aciGGIO2_Ind8_stVal=false,Z_aciGGIO1_Ind3_stVal=false,Z_aciGGIO1_Ind6_stVal=false,Z_aciGGIO1_Ind9_stVal=false,Z_aciGGIO2_Ind3_stVal=false,Z_aciGGIO2_Ind6_stVal=false,Z_aciGGIO2_Ind9_stVal=false,Z_acbGGIO1_Ind2_stVal=false,Z_chmGGIO1_Ind1_stVal=false,Z_chmGGIO2_Ind1_stVal=false,Z_chmGGIO3_Ind1_stVal=false,Z_chmGGIO4_Ind1_stVal=false,Z_chmGGIO5_Ind1_stVal=false,Z_chmGGIO6_Ind1_stVal=false,Z_chmGGIO7_Ind1_stVal=false,Z_chmGGIO8_Ind1_stVal=false,Z_chmGGIO9_Ind1_stVal=false,Z_chmGGIO10_Ind1_stVal=false,Z_chmGGIO11_Ind1_stVal=false,Z_chmGGIO12_Ind1_stVal=false,Z_chmGGIO13_Ind1_stVal=false,Z_chmGGIO14_Ind1_stVal=false,Z_chmGGIO15_Ind1_stVal=false,Z_chmGGIO16_Ind1_stVal=false,Z_chmGGIO17_Ind1_stVal=false,Z_chmGGIO18_Ind1_stVal=false,Z_chmGGIO19_Ind1_stVal=false,Z_chmGGIO20_Ind1_stVal=false,Z_chmGGIO1_Ind2_stVal=false,Z_chmGGIO2_Ind2_stVal=false,Z_chmGGIO3_Ind2_stVal=false,Z_chmGGIO4_Ind2_stVal=false,Z_chmGGIO5_Ind2_stVal=false,Z_chmGGIO6_Ind2_stVal=false,Z_chmGGIO7_Ind2_stVal=false,Z_chmGGIO8_Ind2_stVal=false,Z_chmGGIO9_Ind2_stVal=false,Z_chmGGIO10_Ind2_stVal=false,Z_chmGGIO11_Ind2_stVal=false,Z_chmGGIO12_Ind2_stVal=false,Z_chmGGIO13_Ind2_stVal=false,Z_chmGGIO14_Ind2_stVal=false,Z_chmGGIO15_Ind2_stVal=false,Z_chmGGIO16_Ind2_stVal=false,Z_chmGGIO17_Ind2_stVal=false,Z_chmGGIO18_Ind2_stVal=false,Z_chmGGIO19_Ind2_stVal=false,Z_chmGGIO20_Ind2_stVal=false,Z_calmGGIO1_Alm_stVal=false,Z_dbmGGIO1_Ind1_stVal=false,Z_dbmGGIO1_Ind2_stVal=false,Z_btgGGIO1_Ind4_stVal=false,Z_gswGGIO4_Alm_stVal=false,Z_gswGGIO5_Alm_stVal=false,Z_gswGGIO3_Alm_stVal=false,Z_cheGGIO1_Ind1_stVal=false,Z_gdsGGIO1_IntIn_stVal=0,Z_cheGGIO1_LoBatVal_mag_f=0.0,Z_cheGGIO1_LoBatAh_mag_f=0.0,Z_cheGGIO1_HiTestTmhour_mag_f=0.0 1668133913171 配置文件已经指定了smlChildTableName参数,指定生成子表名称 最终结果: e36c45e59483e83a1ef427f2654bdfe 还是默认产生的子表名是根据规则生成的唯一 ID 值,并未生成我指定的子表名称

huolibo commented 2 years ago

配置问题,我本地测试是生效的。以下是我的示例代码

@RunWith(CatalogRunner.class)
@TestTarget(alias = "Schemaless", author = "huolibo", version = "2.0.36")
public class SchemalessInsertTest {
    private static String host = "127.0.0.1";
    private final String dbname = "test_schemaless_insert";
    private Connection conn;

    @Test
    @Description("line insert")
    public void schemalessInsert() throws SQLException {
        // given
        String[] lines = new String[]{
                "S_root_1589790298655502338_127_0_0_1_102_ZJDYCPSS2_V28,tname=Z_root_1589790298655502338_127_0_0_1_102_ZJDYCPSS2_V28,location=root_1589790298655502338_127_0_0_1_102_ZJDYCPSS2_V28,groupid=1 Z_aciGGIO1_AnIn1_mag_f=0.0,Z_aciGGIO1_AnIn2_mag_f=0.0,Z_aciGGIO1_AnIn3_mag_f=0.0,Z_aciGGIO2_AnIn1_mag_f=0.0,Z_aciGGIO2_AnIn2_mag_f=0.0,Z_aciGGIO2_AnIn3_mag_f=0.0,Z_acbGGIO1_AnIn1_mag_f=0.0,Z_acbGGIO1_AnIn2_mag_f=0.0,Z_acbGGIO1_AnIn3_mag_f=0.0,Z_acbGGIO1_AnIn4_mag_f=0.0,Z_acbGGIO1_AnIn5_mag_f=0.0,Z_acbGGIO1_AnIn6_mag_f=0.0,Z_dbmGGIO1_AnIn1_mag_f=0.0,Z_dbmGGIO1_AnIn2_mag_f=0.0,Z_btgGGIO1_AnIn2_mag_f=0.0,Z_cheGGIO1_AnIn4_mag_f=0.0,Z_cheGGIO1_AnIn2_mag_f=0.0,Z_cheGGIO1_AnIn3_mag_f=0.0,Z_btgGGIO1_AnIn1_mag_f=0.0,Z_btgGGIO2_AnIn1_mag_f=0.0,Z_etmGGIO1_AnIn1_mag_f=0.0,Z_chmGGIO1_AnIn1_mag_f=0.0,Z_chmGGIO2_AnIn1_mag_f=0.0,Z_chmGGIO3_AnIn1_mag_f=0.0,Z_chmGGIO4_AnIn1_mag_f=0.0,Z_chmGGIO5_AnIn1_mag_f=0.0,Z_chmGGIO6_AnIn1_mag_f=0.0,Z_chmGGIO7_AnIn1_mag_f=0.0,Z_chmGGIO8_AnIn1_mag_f=0.0,Z_chmGGIO9_AnIn1_mag_f=0.0,Z_chmGGIO10_AnIn1_mag_f=0.0,Z_chmGGIO11_AnIn1_mag_f=0.0,Z_chmGGIO12_AnIn1_mag_f=0.0,Z_chmGGIO13_AnIn1_mag_f=0.0,Z_chmGGIO14_AnIn1_mag_f=0.0,Z_chmGGIO15_AnIn1_mag_f=0.0,Z_chmGGIO16_AnIn1_mag_f=0.0,Z_chmGGIO17_AnIn1_mag_f=0.0,Z_chmGGIO18_AnIn1_mag_f=0.0,Z_chmGGIO19_AnIn1_mag_f=0.0,Z_chmGGIO20_AnIn1_mag_f=0.0,Z_aciGGIO1_AnIn7_mag_f=0.0,Z_aciGGIO1_AnIn8_mag_f=0.0,Z_dbmGGIO1_AnIn3_mag_f=0.0,Z_dbmGGIO1_AnIn4_mag_f=0.0,Z_aciGGIO1_Ind10_stVal=false,Z_aciGGIO2_Ind10_stVal=false,Z_aciGGIO1_Ind11_stVal=false,Z_aciGGIO2_Ind11_stVal=false,Z_gswGGIO1_Alm_stVal=false,Z_gswGGIO2_Alm_stVal=false,Z_aciGGIO1_Ind1_stVal=false,Z_aciGGIO1_Ind2_stVal=false,Z_aciGGIO1_Ind4_stVal=false,Z_aciGGIO1_Ind5_stVal=false,Z_aciGGIO1_Ind7_stVal=false,Z_aciGGIO1_Ind8_stVal=false,Z_aciGGIO2_Ind1_stVal=false,Z_aciGGIO2_Ind2_stVal=false,Z_aciGGIO2_Ind4_stVal=false,Z_aciGGIO2_Ind5_stVal=false,Z_aciGGIO2_Ind7_stVal=false,Z_aciGGIO2_Ind8_stVal=false,Z_aciGGIO1_Ind3_stVal=false,Z_aciGGIO1_Ind6_stVal=false,Z_aciGGIO1_Ind9_stVal=false,Z_aciGGIO2_Ind3_stVal=false,Z_aciGGIO2_Ind6_stVal=false,Z_aciGGIO2_Ind9_stVal=false,Z_acbGGIO1_Ind2_stVal=false,Z_chmGGIO1_Ind1_stVal=false,Z_chmGGIO2_Ind1_stVal=false,Z_chmGGIO3_Ind1_stVal=false,Z_chmGGIO4_Ind1_stVal=false,Z_chmGGIO5_Ind1_stVal=false,Z_chmGGIO6_Ind1_stVal=false,Z_chmGGIO7_Ind1_stVal=false,Z_chmGGIO8_Ind1_stVal=false,Z_chmGGIO9_Ind1_stVal=false,Z_chmGGIO10_Ind1_stVal=false,Z_chmGGIO11_Ind1_stVal=false,Z_chmGGIO12_Ind1_stVal=false,Z_chmGGIO13_Ind1_stVal=false,Z_chmGGIO14_Ind1_stVal=false,Z_chmGGIO15_Ind1_stVal=false,Z_chmGGIO16_Ind1_stVal=false,Z_chmGGIO17_Ind1_stVal=false,Z_chmGGIO18_Ind1_stVal=false,Z_chmGGIO19_Ind1_stVal=false,Z_chmGGIO20_Ind1_stVal=false,Z_chmGGIO1_Ind2_stVal=false,Z_chmGGIO2_Ind2_stVal=false,Z_chmGGIO3_Ind2_stVal=false,Z_chmGGIO4_Ind2_stVal=false,Z_chmGGIO5_Ind2_stVal=false,Z_chmGGIO6_Ind2_stVal=false,Z_chmGGIO7_Ind2_stVal=false,Z_chmGGIO8_Ind2_stVal=false,Z_chmGGIO9_Ind2_stVal=false,Z_chmGGIO10_Ind2_stVal=false,Z_chmGGIO11_Ind2_stVal=false,Z_chmGGIO12_Ind2_stVal=false,Z_chmGGIO13_Ind2_stVal=false,Z_chmGGIO14_Ind2_stVal=false,Z_chmGGIO15_Ind2_stVal=false,Z_chmGGIO16_Ind2_stVal=false,Z_chmGGIO17_Ind2_stVal=false,Z_chmGGIO18_Ind2_stVal=false,Z_chmGGIO19_Ind2_stVal=false,Z_chmGGIO20_Ind2_stVal=false,Z_calmGGIO1_Alm_stVal=false,Z_dbmGGIO1_Ind1_stVal=false,Z_dbmGGIO1_Ind2_stVal=false,Z_btgGGIO1_Ind4_stVal=false,Z_gswGGIO4_Alm_stVal=false,Z_gswGGIO5_Alm_stVal=false,Z_gswGGIO3_Alm_stVal=false,Z_cheGGIO1_Ind1_stVal=false,Z_gdsGGIO1_IntIn_stVal=0,Z_cheGGIO1_LoBatVal_mag_f=0.0,Z_cheGGIO1_LoBatAh_mag_f=0.0,Z_cheGGIO1_HiTestTmhour_mag_f=0.0 1668133913171"
        };
        // when
        SchemalessWriter writer = new SchemalessWriter(conn);
        writer.write(lines, SchemalessProtocolType.LINE, SchemalessTimestampType.NANO_SECONDS);

        // then
        Statement statement = conn.createStatement();
        ResultSet rs = statement.executeQuery("show tables");
        Assert.assertNotNull(rs);
        ResultSetMetaData metaData = rs.getMetaData();
        Assert.assertTrue(metaData.getColumnCount() > 0);
        int rowCnt = 0;
        while (rs.next()) {
            rowCnt++;
        }
        Assert.assertEquals(lines.length, rowCnt);
        rs.close();
        statement.close();
    }

    @Before
    public void before() throws SQLException {
        String url = SpecifyAddress.getInstance().getJniUrl();
        if (url == null) {
            url = "jdbc:TAOS://" + host + ":6030/?user=root&password=taosdata";
        }
        conn = DriverManager.getConnection(url);
        Statement stmt = conn.createStatement();
        stmt.execute("drop database if exists " + dbname);
        stmt.execute("create database if not exists " + dbname + " precision 'ns'");
        stmt.execute("use " + dbname);
    }
}

配置文件 image 结果显示: image

YANGQINZ commented 2 years ago

配置问题,我本地测试是生效的。以下是我的示例代码

@RunWith(CatalogRunner.class)
@TestTarget(alias = "Schemaless", author = "huolibo", version = "2.0.36")
public class SchemalessInsertTest {
    private static String host = "127.0.0.1";
    private final String dbname = "test_schemaless_insert";
    private Connection conn;

    @Test
    @Description("line insert")
    public void schemalessInsert() throws SQLException {
        // given
        String[] lines = new String[]{
                "S_root_1589790298655502338_127_0_0_1_102_ZJDYCPSS2_V28,tname=Z_root_1589790298655502338_127_0_0_1_102_ZJDYCPSS2_V28,location=root_1589790298655502338_127_0_0_1_102_ZJDYCPSS2_V28,groupid=1 Z_aciGGIO1_AnIn1_mag_f=0.0,Z_aciGGIO1_AnIn2_mag_f=0.0,Z_aciGGIO1_AnIn3_mag_f=0.0,Z_aciGGIO2_AnIn1_mag_f=0.0,Z_aciGGIO2_AnIn2_mag_f=0.0,Z_aciGGIO2_AnIn3_mag_f=0.0,Z_acbGGIO1_AnIn1_mag_f=0.0,Z_acbGGIO1_AnIn2_mag_f=0.0,Z_acbGGIO1_AnIn3_mag_f=0.0,Z_acbGGIO1_AnIn4_mag_f=0.0,Z_acbGGIO1_AnIn5_mag_f=0.0,Z_acbGGIO1_AnIn6_mag_f=0.0,Z_dbmGGIO1_AnIn1_mag_f=0.0,Z_dbmGGIO1_AnIn2_mag_f=0.0,Z_btgGGIO1_AnIn2_mag_f=0.0,Z_cheGGIO1_AnIn4_mag_f=0.0,Z_cheGGIO1_AnIn2_mag_f=0.0,Z_cheGGIO1_AnIn3_mag_f=0.0,Z_btgGGIO1_AnIn1_mag_f=0.0,Z_btgGGIO2_AnIn1_mag_f=0.0,Z_etmGGIO1_AnIn1_mag_f=0.0,Z_chmGGIO1_AnIn1_mag_f=0.0,Z_chmGGIO2_AnIn1_mag_f=0.0,Z_chmGGIO3_AnIn1_mag_f=0.0,Z_chmGGIO4_AnIn1_mag_f=0.0,Z_chmGGIO5_AnIn1_mag_f=0.0,Z_chmGGIO6_AnIn1_mag_f=0.0,Z_chmGGIO7_AnIn1_mag_f=0.0,Z_chmGGIO8_AnIn1_mag_f=0.0,Z_chmGGIO9_AnIn1_mag_f=0.0,Z_chmGGIO10_AnIn1_mag_f=0.0,Z_chmGGIO11_AnIn1_mag_f=0.0,Z_chmGGIO12_AnIn1_mag_f=0.0,Z_chmGGIO13_AnIn1_mag_f=0.0,Z_chmGGIO14_AnIn1_mag_f=0.0,Z_chmGGIO15_AnIn1_mag_f=0.0,Z_chmGGIO16_AnIn1_mag_f=0.0,Z_chmGGIO17_AnIn1_mag_f=0.0,Z_chmGGIO18_AnIn1_mag_f=0.0,Z_chmGGIO19_AnIn1_mag_f=0.0,Z_chmGGIO20_AnIn1_mag_f=0.0,Z_aciGGIO1_AnIn7_mag_f=0.0,Z_aciGGIO1_AnIn8_mag_f=0.0,Z_dbmGGIO1_AnIn3_mag_f=0.0,Z_dbmGGIO1_AnIn4_mag_f=0.0,Z_aciGGIO1_Ind10_stVal=false,Z_aciGGIO2_Ind10_stVal=false,Z_aciGGIO1_Ind11_stVal=false,Z_aciGGIO2_Ind11_stVal=false,Z_gswGGIO1_Alm_stVal=false,Z_gswGGIO2_Alm_stVal=false,Z_aciGGIO1_Ind1_stVal=false,Z_aciGGIO1_Ind2_stVal=false,Z_aciGGIO1_Ind4_stVal=false,Z_aciGGIO1_Ind5_stVal=false,Z_aciGGIO1_Ind7_stVal=false,Z_aciGGIO1_Ind8_stVal=false,Z_aciGGIO2_Ind1_stVal=false,Z_aciGGIO2_Ind2_stVal=false,Z_aciGGIO2_Ind4_stVal=false,Z_aciGGIO2_Ind5_stVal=false,Z_aciGGIO2_Ind7_stVal=false,Z_aciGGIO2_Ind8_stVal=false,Z_aciGGIO1_Ind3_stVal=false,Z_aciGGIO1_Ind6_stVal=false,Z_aciGGIO1_Ind9_stVal=false,Z_aciGGIO2_Ind3_stVal=false,Z_aciGGIO2_Ind6_stVal=false,Z_aciGGIO2_Ind9_stVal=false,Z_acbGGIO1_Ind2_stVal=false,Z_chmGGIO1_Ind1_stVal=false,Z_chmGGIO2_Ind1_stVal=false,Z_chmGGIO3_Ind1_stVal=false,Z_chmGGIO4_Ind1_stVal=false,Z_chmGGIO5_Ind1_stVal=false,Z_chmGGIO6_Ind1_stVal=false,Z_chmGGIO7_Ind1_stVal=false,Z_chmGGIO8_Ind1_stVal=false,Z_chmGGIO9_Ind1_stVal=false,Z_chmGGIO10_Ind1_stVal=false,Z_chmGGIO11_Ind1_stVal=false,Z_chmGGIO12_Ind1_stVal=false,Z_chmGGIO13_Ind1_stVal=false,Z_chmGGIO14_Ind1_stVal=false,Z_chmGGIO15_Ind1_stVal=false,Z_chmGGIO16_Ind1_stVal=false,Z_chmGGIO17_Ind1_stVal=false,Z_chmGGIO18_Ind1_stVal=false,Z_chmGGIO19_Ind1_stVal=false,Z_chmGGIO20_Ind1_stVal=false,Z_chmGGIO1_Ind2_stVal=false,Z_chmGGIO2_Ind2_stVal=false,Z_chmGGIO3_Ind2_stVal=false,Z_chmGGIO4_Ind2_stVal=false,Z_chmGGIO5_Ind2_stVal=false,Z_chmGGIO6_Ind2_stVal=false,Z_chmGGIO7_Ind2_stVal=false,Z_chmGGIO8_Ind2_stVal=false,Z_chmGGIO9_Ind2_stVal=false,Z_chmGGIO10_Ind2_stVal=false,Z_chmGGIO11_Ind2_stVal=false,Z_chmGGIO12_Ind2_stVal=false,Z_chmGGIO13_Ind2_stVal=false,Z_chmGGIO14_Ind2_stVal=false,Z_chmGGIO15_Ind2_stVal=false,Z_chmGGIO16_Ind2_stVal=false,Z_chmGGIO17_Ind2_stVal=false,Z_chmGGIO18_Ind2_stVal=false,Z_chmGGIO19_Ind2_stVal=false,Z_chmGGIO20_Ind2_stVal=false,Z_calmGGIO1_Alm_stVal=false,Z_dbmGGIO1_Ind1_stVal=false,Z_dbmGGIO1_Ind2_stVal=false,Z_btgGGIO1_Ind4_stVal=false,Z_gswGGIO4_Alm_stVal=false,Z_gswGGIO5_Alm_stVal=false,Z_gswGGIO3_Alm_stVal=false,Z_cheGGIO1_Ind1_stVal=false,Z_gdsGGIO1_IntIn_stVal=0,Z_cheGGIO1_LoBatVal_mag_f=0.0,Z_cheGGIO1_LoBatAh_mag_f=0.0,Z_cheGGIO1_HiTestTmhour_mag_f=0.0 1668133913171"
        };
        // when
        SchemalessWriter writer = new SchemalessWriter(conn);
        writer.write(lines, SchemalessProtocolType.LINE, SchemalessTimestampType.NANO_SECONDS);

        // then
        Statement statement = conn.createStatement();
        ResultSet rs = statement.executeQuery("show tables");
        Assert.assertNotNull(rs);
        ResultSetMetaData metaData = rs.getMetaData();
        Assert.assertTrue(metaData.getColumnCount() > 0);
        int rowCnt = 0;
        while (rs.next()) {
            rowCnt++;
        }
        Assert.assertEquals(lines.length, rowCnt);
        rs.close();
        statement.close();
    }

    @Before
    public void before() throws SQLException {
        String url = SpecifyAddress.getInstance().getJniUrl();
        if (url == null) {
            url = "jdbc:TAOS://" + host + ":6030/?user=root&password=taosdata";
        }
        conn = DriverManager.getConnection(url);
        Statement stmt = conn.createStatement();
        stmt.execute("drop database if exists " + dbname);
        stmt.execute("create database if not exists " + dbname + " precision 'ns'");
        stmt.execute("use " + dbname);
    }
}

配置文件 image 结果显示: image

我的也是这个配置 image

huolibo commented 2 years ago

将配置日志的级别设置为 135. 启动后可以看到使用了哪些配置: image

huolibo commented 2 years ago

另外建议使用 docker 环境尝试下能否成功。逐步排查是哪里影响了结果。

YANGQINZ commented 2 years ago

将配置日志的级别设置为 135. 启动后可以看到使用了哪些配置: image

我的也是用的docker环境,logs也能打印出来 image

huolibo commented 2 years ago

这个参数是客户端的,需要在 java 的执行环境中配置此参数。或是将 java 项目放在 docker 中使用同一环境执行。

YANGQINZ commented 2 years ago

这个参数是客户端的,需要在 java 的执行环境中配置此参数。或是将 java 项目放在 docker 中使用同一环境执行。

我现在java项目是本地win运行的,数据库在linux运行,是不是要把我java项目打包到linux的意思呢

YANGQINZ commented 2 years ago

这个参数是客户端的,需要在 java 的执行环境中配置此参数。或是将 java 项目放在 docker 中使用同一环境执行。

问题已经解决了。非常感谢!!!