Skip to content

Commit

Permalink
Improvising high availability field name in hive hook (#39658)
Browse files Browse the repository at this point in the history
* Improvising high availability field name in hive hook

* updating per hussein's suggestion

Co-authored-by: Hussein Awala <hussein@awala.fr>

---------

Co-authored-by: Hussein Awala <hussein@awala.fr>
  • Loading branch information
amoghrajesh and hussein-awala authored May 16, 2024
1 parent 9aae531 commit ea8ed7c
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit ea8ed7c

Please sign in to comment.