需求:
使用trino查询hive,clickhouse,paimon,mysql等,并使用trino自带的权限系统进行管控。
package com.xxx;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import com.xxx.config.TrinoConfig;
import io.trino.jdbc.$internal.airlift.units.Duration;
import io.trino.jdbc.$internal.client.*;
import io.trino.jdbc.$internal.okhttp3.OkHttpClient;
import io.trino.jdbc.$internal.okhttp3.internal.connection.ConnectInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import java.net.URI;
import java.time.ZoneId;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class TrinoClient {
@Autowired
private TrinoConfig trinoConfig;
private static volatile TrinoClient trinoClient;
public static TrinoClient getInstance() {
if (trinoClient == null) {
synchronized (TrinoClient.class) {