问题描述
我正在尝试使用 odbc 连接器通过雪花运行我的查询仅 30 秒......即如果查询执行时间超过 30 秒,它应该立即停止并失败。
在 odbc 连接中,我传递了一个参数 query_timeout 来实现这一点。 我的 odbc 连接代码:
<?PHP
class SNowflakeConnection{
private $server;
private $user_name;
private $password;
private $port;
private $schema;
private $warehouse;
private $database;
private $connection;
private $dsn;
public function __construct($server,$port,$user,$password,$database,$schema,$warehouse){
$this->server=$server;
$this->port=$port;
$this->user_name=$user;
$this->password=$password;
$this->database=$database;
$this->schema=$schema;
$this->warehouse=$warehouse;
$this->dsn = "Driver=SNowflakeDSIIDriver;Server=" . $server;
$this->dsn .= ";Port=" . $port;
$this->dsn .= ";Schema=" . $schema;
$this->dsn .= ";Warehouse=" . $warehouse;
$this->dsn .= ";Database=" . $database;
$this->dsn .= ";query_timeout = 30";
}
但不是 30 秒,我的查询运行了 45 秒,然后失败并给我一个错误。 错误消息:
基本上,我的查询正在运行一段时间,而不是我在参数中传递的 query_timeout 值。
谁能帮我在 odbc 中使用代码设置确切的超时时间(如 30 秒或 1 分钟)??
注意:我也尝试过将 45 设置为 query_timeout 值,但是对于 45,查询运行了 1 分 30 秒
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)