mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-22 16:08:13 +00:00
* Trino fix #705 * Update trino.json to point to default database
This commit is contained in:
parent
28e1d2977b
commit
a19c5bceca
@ -3,8 +3,8 @@
|
|||||||
"type": "trino",
|
"type": "trino",
|
||||||
"config": {
|
"config": {
|
||||||
"service_name": "local_trino",
|
"service_name": "local_trino",
|
||||||
"host_port": "192.168.1.32:8080",
|
"host_port": "localhost:8080",
|
||||||
"database": "default"
|
"catalog": "system"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sink": {
|
"sink": {
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
from typing import Optional
|
||||||
from urllib.parse import quote_plus
|
from urllib.parse import quote_plus
|
||||||
|
|
||||||
from .sql_source import SQLSource, SQLConnectionConfig
|
from .sql_source import SQLSource, SQLConnectionConfig
|
||||||
@ -22,6 +23,8 @@ class TrinoConfig(SQLConnectionConfig):
|
|||||||
host_port = "localhost:8080"
|
host_port = "localhost:8080"
|
||||||
scheme = "trino"
|
scheme = "trino"
|
||||||
service_type = "Trino"
|
service_type = "Trino"
|
||||||
|
catalog: str
|
||||||
|
schema_name: Optional[str]
|
||||||
|
|
||||||
def get_connection_url(self):
|
def get_connection_url(self):
|
||||||
url = f"{self.scheme}://"
|
url = f"{self.scheme}://"
|
||||||
@ -30,8 +33,10 @@ class TrinoConfig(SQLConnectionConfig):
|
|||||||
if self.password:
|
if self.password:
|
||||||
url += f":{quote_plus(self.password)}"
|
url += f":{quote_plus(self.password)}"
|
||||||
url += f"{self.host_port}"
|
url += f"{self.host_port}"
|
||||||
if self.database:
|
if self.catalog:
|
||||||
url += f"?schema={quote_plus(self.database)}"
|
url += f"/{quote_plus(self.catalog)}"
|
||||||
|
if self.schema_name:
|
||||||
|
url += f"/{quote_plus(self.schema_name)}"
|
||||||
return url
|
return url
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user