-
Notifications
You must be signed in to change notification settings - Fork 1
Add Apache HBase Provider #8
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
base: v2-10-stable
Are you sure you want to change the base?
Conversation
Basic HBase provider
Feature/ado 368
Feature/ado 336
ADO-334 Optimization (bulk insert and connection pools)
Build changes for python 3.10
| exists = bool(row_data) | ||
| self.log.info("Row %s in table %s exists: %s", self.row_key, self.table_name, exists) | ||
| return exists | ||
| except Exception as e: |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove exception handling to forward exceptions higher to allow Airflow handling them and retry out of the box
| self.log.info("Table %s has %d rows, expected: %d", self.table_name, row_count, | ||
| self.expected_count) | ||
| return row_count == self.expected_count | ||
| except Exception as e: |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove exception handling to forward exceptions higher to allow Airflow handling them and retry out of the box
| self.column, self.row_key, self.expected_value, actual_value | ||
| ) | ||
| return matches | ||
| except Exception as e: |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove exception handling to forward exceptions higher to allow Airflow handling them and retry out of the box
dags/example_bash_operator.py
Outdated
| } | ||
|
|
||
| dag = DAG( | ||
| "example_hbase_backup_simple", |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an old version from the development and testing process. The point is Airflow copies dags in /dags folder to operate. I will remove it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we need DAG-examples?
I don't like this default DAG-name without DAG in file system.
May be I don't right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, you right. I hide this comment.
| - airflow.providers.hbase.example_dags.example_hbase | ||
| - airflow.providers.hbase.example_dags.example_hbase_ssl | ||
| - airflow.providers.hbase.example_dags.example_hbase_advanced | ||
| - airflow.providers.hbase.example_dags.example_hbase_backup_simple No newline at end of file |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an old version from the development and testing process. The point is Airflow copies dags in /dags folder to operate. I will remove it
|
|
||
| def __init__( | ||
| self, | ||
| action: str, |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added Enum logic
| return False | ||
|
|
||
|
|
||
| class HBaseRowCountSensor(BaseSensorOperator): |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Warning added
| self.log.info("Row %s not found in table %s", self.row_key, self.table_name) | ||
| return False | ||
|
|
||
| actual_value = row_data.get(self.column.encode('utf-8'), b'').decode('utf-8') |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Direct bytes comparison added, test added
| name: Standard | ||
| description: Empty standard provider | ||
| state: ready | ||
| source-date-epoch: 1734000000 |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems, I copied it from another provider but it doesn't matter: it's managed by a release manager
| `Apache HBase <https://hbase.apache.org/>`__ | ||
|
|
||
| state: ready | ||
| source-date-epoch: 1734000000 |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems, I copied it from another provider but it doesn't matter: it's managed by a release manager. Nonetheless, changed it to an actual date for the Hbase provider
Feature/hbase provider review
Add current date for Hbase provider
Add Apache HBase Provider
This PR introduces a new Apache HBase Provider for Apache Airflow, enabling seamless integration with Apache HBase - a distributed, scalable, big data store built on Apache Hadoop.
Features