villebro commented on code in PR #22635:
URL: https://github.com/apache/superset/pull/22635#discussion_r1065404439


##########
superset/db_engine_specs/impala.py:
##########
@@ -14,20 +14,31 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
+import logging
+import re
+import time
 from datetime import datetime
 from typing import Any, Dict, List, Optional
 
+from flask import current_app
 from sqlalchemy.engine.reflection import Inspector
+from sqlalchemy.orm import Session
 
+from superset.constants import QUERY_EARLY_CANCEL_KEY
 from superset.db_engine_specs.base import BaseEngineSpec
+from superset.models.sql_lab import Query
 from superset.utils import core as utils
 
+logger = logging.getLogger(__name__)
+
 
 class ImpalaEngineSpec(BaseEngineSpec):
     """Engine spec for Cloudera's Impala"""
 
     engine = "impala"
     engine_name = "Apache Impala"
+    # Query 5543ffdf692b7d02:f78a944000000000: 3% Complete (17 out of 547)
+    query_progress_r = re.compile(r".*Query.*: (?P<query_progress>[0-9]+)%.*")

Review Comment:
   nit: do we really need the leading and trailing `.*` here? 
   ```suggestion
       query_progress_r = re.compile(r"Query.*: (?P<query_progress>[0-9]+)%")
   ```
   
   Also, I know this is in line with what's being done in `hive.py`, but I 
would consider moving this outside the class into a constant 
`QUERY_PROGRESS_REGEX` in `impala.py`, as it's not defined in `BaseEngineSpec` 
(defining it here makes it appear like we're overriding a class attribute in 
`BaseEngineSpec`). While at it, maybe do the same for `stage_progress_r` in 
`HiveEngineSpec`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to