io.edurt.datacap.plugin.jdbc.kyuubi.KyuubiAdapter Maven / Gradle / Ivy
package io.edurt.datacap.plugin.jdbc.kyuubi;
import com.google.common.collect.Lists;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.edurt.datacap.spi.adapter.JdbcAdapter;
import io.edurt.datacap.spi.column.JdbcColumn;
import io.edurt.datacap.spi.connection.JdbcConfigure;
import io.edurt.datacap.spi.connection.JdbcConnection;
import io.edurt.datacap.spi.model.Response;
import io.edurt.datacap.spi.model.Time;
import lombok.extern.slf4j.Slf4j;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Objects;
@Slf4j
@SuppressFBWarnings(value = {"RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE"},
justification = "I prefer to suppress these FindBugs warnings")
public class KyuubiAdapter
extends JdbcAdapter
{
public KyuubiAdapter(JdbcConnection jdbcConnection)
{
super(jdbcConnection);
}
@Override
public Response handlerExecute(String content)
{
Time processorTime = new Time();
processorTime.setStart(new Date().getTime());
Response response = this.connection.getResponse();
Connection connection = (Connection) this.connection.getConnection();
JdbcConfigure configure = (JdbcConfigure) this.connection.getConfigure();
if (response.getIsConnected()) {
try (PreparedStatement statement = connection.prepareStatement(content)) {
List headers = new ArrayList<>();
List types = new ArrayList<>();
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy