Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvising high availability field name in hive hook #39658

Merged
merged 2 commits into from
May 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions airflow/providers/apache/hive/hooks/hive.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def get_connection_form_widgets(cls) -> dict[str, Any]:
"principal": StringField(
lazy_gettext("Principal"), widget=BS3TextFieldWidget(), default="hive/_HOST@EXAMPLE.COM"
),
"high_availability": BooleanField(lazy_gettext("High Availability"), default=False),
"high_availability": BooleanField(lazy_gettext("High Availability mode"), default=False),
}

@classmethod
Expand Down Expand Up @@ -160,10 +160,10 @@ def _prepare_cli_cmd(self) -> list[Any]:
self._validate_beeline_parameters(conn)
if self.high_availability:
jdbc_url = f"jdbc:hive2://{conn.host}/{conn.schema}"
self.log.info("High Availability set, setting JDBC url as %s", jdbc_url)
self.log.info("High Availability selected, setting JDBC url as %s", jdbc_url)
else:
jdbc_url = f"jdbc:hive2://{conn.host}:{conn.port}/{conn.schema}"
self.log.info("High Availability not set, setting JDBC url as %s", jdbc_url)
self.log.info("High Availability not selected, setting JDBC url as %s", jdbc_url)
if conf.get("core", "security") == "kerberos":
template = conn.extra_dejson.get("principal", "hive/_HOST@EXAMPLE.COM")
if "_HOST" in template:
Expand Down