Skip to content

Commit

Permalink
[ozone] Add fs_defaultfs in path in importer
Browse files Browse the repository at this point in the history
(cherry picked from commit 957fe50)
  • Loading branch information
agl29 authored and Harshg999 committed Mar 10, 2023
1 parent ce14518 commit 71a90da
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions desktop/libs/indexer/src/indexer/indexers/sql.py
Expand Up @@ -33,6 +33,7 @@
from notebook.models import make_notebook
from useradmin.models import User

from desktop.conf import OZONE
from desktop.lib import django_mako
from desktop.lib.exceptions_renderable import PopupException
from desktop.settings import BASE_DIR
Expand Down Expand Up @@ -83,6 +84,7 @@ def create_table_from_a_file(self, source, destination, start_time=-1, file_enco
comment = destination['description']

source_path = source['path']
ozone_service_id = OZONE.get()['default'].FS_DEFAULTFS.get()[6:]
load_data = destination['importData']
isIceberg = destination['isIceberg']

Expand Down Expand Up @@ -182,6 +184,11 @@ def create_table_from_a_file(self, source, destination, start_time=-1, file_enco

if external_path.lower().startswith("abfs"): #this is to check if its using an ABFS path
external_path = abfspath(external_path)
elif external_path.lower().startswith("ofs") or source_path.lower().startswith("ofs"): #this is to check if its using an OFS path
# as of now ozone has 3 managers and impala/hive don't know on which manager
# they need to ping hence we are sending the ozone_service_id with path
external_path = external_path[:6] + ozone_service_id + external_path[5:]
source_path = source_path[:6] + ozone_service_id + source_path[5:]

tbl_properties = OrderedDict()
if skip_header:
Expand Down

0 comments on commit 71a90da

Please sign in to comment.