From d4cc709b4367e93c86aceb2a95dd14e23cf3ff4a Mon Sep 17 00:00:00 2001 From: Yury Fridlyand Date: Tue, 14 Dec 2021 16:59:19 -0800 Subject: [PATCH 1/5] According to AOS-248, we have to build the server address string properly: - add http[s]:// prefix - add port In scope of this task 2 new fields were added to the connection dialog (port, useSSL) and the corresponding handling. Signed-off-by: Yury Fridlyand --- .../PowerBIConnector/SqlOdbcPBIConnector.pq | 48 +++++++++++++++---- .../SqlOdbcPBIConnector.query.pq | 8 ++-- 2 files changed, 45 insertions(+), 11 deletions(-) diff --git a/sql-odbc/src/PowerBIConnector/SqlOdbcPBIConnector.pq b/sql-odbc/src/PowerBIConnector/SqlOdbcPBIConnector.pq index 0a4bbf09eb..04514fa0c8 100644 --- a/sql-odbc/src/PowerBIConnector/SqlOdbcPBIConnector.pq +++ b/sql-odbc/src/PowerBIConnector/SqlOdbcPBIConnector.pq @@ -15,14 +15,24 @@ SqlOdbcPBIConnectorType = type function ( Server as (type text meta [ Documentation.FieldCaption = "Server", Documentation.FieldDescription = "The hostname of the OpenSearch server.", - Documentation.SampleValues = { "localhost:9200" } + Documentation.SampleValues = { "localhost" } + ]), + Port as (type number meta [ + Documentation.FieldCaption = "Port", + Documentation.FieldDescription = "Port which OpenSearch server listens to.", + Documentation.SampleValues = { 9200 } + ]), + UseSSL as (type logical meta [ + Documentation.FieldCaption = "Use SSL", + Documentation.FieldDescription = "Use SSL", + Documentation.AllowedValues = { true, false } ]) ) as table meta [ Documentation.Name = "OpenSearch" ]; -SqlOdbcPBIConnectorImpl = (Server as text) as table => +SqlOdbcPBIConnectorImpl = (Server as text, Port as number, UseSSL as logical) as table => let Credential = Extension.CurrentCredential(), AuthenticationMode = Credential[AuthenticationKind], @@ -56,9 +66,29 @@ SqlOdbcPBIConnectorImpl = (Server as text) as table => UseSSL = 0 ], + // Substract the server from the user input in case if it entered like 'http://localhost' or 'https://srv.com:100500' or 'localhost:0' + ServerWithoutPrefix = + if Text.StartsWith(Server, "http://") then + Text.RemoveRange(Server, 0, 7) + else if Text.StartsWith(Server, "https://") then + Text.RemoveRange(Server, 0, 8) + else + Server, + ServerWithouPrefixAndPort = + if List.Count(Text.Split(ServerWithoutPrefix, ":")) > 1 then + Text.Split(ServerWithoutPrefix, ":"){0} + else + ServerWithoutPrefix, + // And build the proper string on our own + FinalServerString = + if UseSSL then + "https://" & ServerWithouPrefixAndPort & ":" & Text.From(Port) + else + "http://" & ServerWithouPrefixAndPort & ":" & Text.From(Port), + ConnectionString = [ Driver = "OpenSearch SQL ODBC Driver", - Host = Server + Host = FinalServerString ], SQLGetInfo = Diagnostics.LogValue("SQLGetInfo_Options", [ @@ -165,9 +195,11 @@ SqlOdbcPBIConnector = [ TestConnection = (dataSourcePath) => let json = Json.Document(dataSourcePath), - Server = json[Server] + Server = json[Server], + Port = json[Port], + UseSSL = json[UseSSL] in - { "SqlOdbcPBIConnector.Contents", Server }, + { "SqlOdbcPBIConnector.Contents", Server, Port, UseSSL }, // Authentication modes Authentication = [ @@ -186,10 +218,10 @@ SqlOdbcPBIConnector = [ // PBIDS Handler DSRHandlers = [ #"sqlodbc" = [ - GetDSR = (server, schema, object, optional options) => [ protocol = "sqlodbc", address = [ server = server ] ], - GetFormula = (dsr, optional options) => () => + GetDSR = (server, schema, object, optional options) => [ protocol = "sqlodbc", address = [ server = server, port = schema, useSSL = object ] ], + GetFormula = (dsr, optional options) => () => let - db = SqlOdbcPBIConnector.Contents(dsr[address][server]) + db = SqlOdbcPBIConnector.Contents(dsr[address][server], dsr[address][port], dsr[address][useSSL]) in db, GetFriendlyName = (dsr) => "OpenSearch SQL ODBC" diff --git a/sql-odbc/src/PowerBIConnector/SqlOdbcPBIConnector.query.pq b/sql-odbc/src/PowerBIConnector/SqlOdbcPBIConnector.query.pq index e2254d231a..8ca8924487 100644 --- a/sql-odbc/src/PowerBIConnector/SqlOdbcPBIConnector.query.pq +++ b/sql-odbc/src/PowerBIConnector/SqlOdbcPBIConnector.query.pq @@ -4,14 +4,16 @@ section SqlOdbcPBIConnector.UnitTests; shared MyExtension.UnitTest = [ // Common variables for all tests - Host = "localhost:9200", + Host = "localhost", + Port = 9200, + UseSSL = false, facts = { Fact("Connection Test", 7, let - Source = SqlOdbcPBIConnector.Contents(Host), + Source = SqlOdbcPBIConnector.Contents(Host, Port, UseSSL), no_of_columns = Table.ColumnCount(Source) in no_of_columns @@ -20,7 +22,7 @@ shared MyExtension.UnitTest = #table(type table [bool0 = logical], { {null}, {false}, {true} }), let - Source = SqlOdbcPBIConnector.Contents(Host), + Source = SqlOdbcPBIConnector.Contents(Host, Port, UseSSL), calcs_null_null = Source{[Item="calcs",Schema=null,Catalog=null]}[Data], grouped = Table.Group(calcs_null_null, {"bool0"}, {}) in From 562ee41319254cd9bfe39b5d0701444cd0d5309a Mon Sep 17 00:00:00 2001 From: Yury Fridlyand Date: Thu, 16 Dec 2021 15:43:40 -0800 Subject: [PATCH 2/5] Updating docs according to PR #16 comments. Signed-off-by: Yury Fridlyand --- .../img/pbi_connection_string_options.png | Bin 9146 -> 13992 bytes sql-odbc/docs/user/power_bi_support.md | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sql-odbc/docs/user/img/pbi_connection_string_options.png b/sql-odbc/docs/user/img/pbi_connection_string_options.png index 6cc19c61f1a180a71e3111cddab97fff204f781a..f0ac23b72680f4bc0b50dc6ab297aee36e53acce 100644 GIT binary patch literal 13992 zcmdUWXIN9+wk}pgL_|f9sv;mDMG+7XP!LeM^j<`Ilioq8iWCtkQl-}rDG4>92`D9W z0t6Cz3xpa1352`w`|i1WpR><7&wbAQbALdxX4aZz%rVD!$2-RQsG+7vbCKyH1qB7o z%NNfzDJV{NP*9w*xo{q6$#0Ic1U^o=Ybwf8lp|PHfQz#>&s3jLP*lWGA6lFPuBqO> zFmR`!xZHN~cdFB+=nVyhsMO2n&$N9^*QclhbQUr;j$KaQy>MEUg7eCwE3UMA4@WLC zejMXc;0?W3RGnCzO;%Lvh@g`?{W4DT(_vcwU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BCe^ea%H zI|EXiLPOb~b{OZvM{)H=9`HIZl=h_ocl-YrH9H!~9n$n#_QHjxv&~o7=Y|smmH7=~ zz}h{lEMhg-=0y}*jYY(0ryDzG( zr}vQ|JT~q%Ya26ybcmxLx-JXUCMHce+psd3@ z{Ir$CK(W57;^*W4+ApHCMJ z!m|;Sx^_xwrDEezp8@p>Dv4@iL9;RN0#sjO<8Xxtcd2V}7dj69aajA^xTJidA?TY# zZpOF$eah590-AUnXYF}M8ELbkMj?ZH9#6ED4!UAw+(8{8szq6>Tyu-b|F#H5+i-NvO;5!p<)`Kf+yU-s&B zVg7NCpw!&M?dmd#L+aQcSBQo8USH{Z=K=L69|y(b7_ag~iL7Gi=gFtEkdsL{Cr>@3 z4M(~KrDzsm+ggrJdYb7`yLJbPX=4{=J-2g@w_dL3Xs6^((A&+$j{>Z;V6RjfnpMIk zzLs@|X>=5^1^ngq8)5~Yt25i1g}B6alJ#P)E1iH7`gjnKvBv8(9h2N2_#1-6M)0i0 z3Klj$oFIoyatvO6Y|4H?RgatXT%a;*p_GD1A}+1C#s2b{jBZzS57L^Di~m7J8zrZ-1P1j>BD8Ws5Ez z=E)>H6pMD7*QqFhT6C2n_w$XP(bN4$eA~4uyxIL0wetGyWk%LLx+|jlX|WBZ<-;6m z>-UcqKh*{1c8d{V!b=fp4p%j5HK)sGKk7BwKfh%{pTh!0{;r5m?=;t#{sI0oo&Nmm(uwmPZQt;KP!x3W VOXm4j+9n&Ip`xQ)p=9;@{{aCGi$nkb diff --git a/sql-odbc/docs/user/power_bi_support.md b/sql-odbc/docs/user/power_bi_support.md index 72df78794b..d71b9210fe 100644 --- a/sql-odbc/docs/user/power_bi_support.md +++ b/sql-odbc/docs/user/power_bi_support.md @@ -1,4 +1,4 @@ -# Connecting OpenSearch to Microsoft Power BI Desktop +# Connecting OpenSearch to Microsoft Power BI Desktop ## Prerequisites * Microsoft Power BI Desktop @@ -34,7 +34,7 @@ -* Enter server value. Click on **OK**. +* Enter server address, port and select SSL mode. Click on **OK**. From b8d14e9a51b3fd82a32162ba49f9321989bb8ef3 Mon Sep 17 00:00:00 2001 From: Yury-Fridlyand <88679692+Yury-Fridlyand@users.noreply.github.com> Date: Sat, 18 Dec 2021 01:08:03 +0000 Subject: [PATCH 3/5] Update SqlOdbcPBIConnector.pq according to PR review notes Co-authored-by: Kyle Porter --- bi-connectors/PowerBIConnector/SqlOdbcPBIConnector.pq | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bi-connectors/PowerBIConnector/SqlOdbcPBIConnector.pq b/bi-connectors/PowerBIConnector/SqlOdbcPBIConnector.pq index 04514fa0c8..20aea48604 100644 --- a/bi-connectors/PowerBIConnector/SqlOdbcPBIConnector.pq +++ b/bi-connectors/PowerBIConnector/SqlOdbcPBIConnector.pq @@ -66,7 +66,7 @@ SqlOdbcPBIConnectorImpl = (Server as text, Port as number, UseSSL as logical) as UseSSL = 0 ], - // Substract the server from the user input in case if it entered like 'http://localhost' or 'https://srv.com:100500' or 'localhost:0' + // Subtract the server from the user input in case it's entered like 'http://localhost' or 'https://srv.com:100500' or 'localhost:0' ServerWithoutPrefix = if Text.StartsWith(Server, "http://") then Text.RemoveRange(Server, 0, 7) From 7a83e2de0aa4a7c253b34bb8577c1d226f15996d Mon Sep 17 00:00:00 2001 From: Yury-Fridlyand <88679692+Yury-Fridlyand@users.noreply.github.com> Date: Sat, 18 Dec 2021 01:08:22 +0000 Subject: [PATCH 4/5] Update SqlOdbcPBIConnector.pq according to PR review notes Co-authored-by: Kyle Porter --- bi-connectors/PowerBIConnector/SqlOdbcPBIConnector.pq | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bi-connectors/PowerBIConnector/SqlOdbcPBIConnector.pq b/bi-connectors/PowerBIConnector/SqlOdbcPBIConnector.pq index 20aea48604..2b38aca294 100644 --- a/bi-connectors/PowerBIConnector/SqlOdbcPBIConnector.pq +++ b/bi-connectors/PowerBIConnector/SqlOdbcPBIConnector.pq @@ -19,7 +19,7 @@ SqlOdbcPBIConnectorType = type function ( ]), Port as (type number meta [ Documentation.FieldCaption = "Port", - Documentation.FieldDescription = "Port which OpenSearch server listens to.", + Documentation.FieldDescription = "Port which OpenSearch server listens on.", Documentation.SampleValues = { 9200 } ]), UseSSL as (type logical meta [ From 26d29ac21a1a64e436c28db469b0aec7fb17d073 Mon Sep 17 00:00:00 2001 From: Yury Fridlyand Date: Fri, 17 Dec 2021 18:47:58 -0800 Subject: [PATCH 5/5] Modified code that builds the server string Signed-off-by: Yury Fridlyand --- .../PowerBIConnector/SqlOdbcPBIConnector.pq | 21 ++++--------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/bi-connectors/PowerBIConnector/SqlOdbcPBIConnector.pq b/bi-connectors/PowerBIConnector/SqlOdbcPBIConnector.pq index 04514fa0c8..d553472527 100644 --- a/bi-connectors/PowerBIConnector/SqlOdbcPBIConnector.pq +++ b/bi-connectors/PowerBIConnector/SqlOdbcPBIConnector.pq @@ -67,24 +67,11 @@ SqlOdbcPBIConnectorImpl = (Server as text, Port as number, UseSSL as logical) as ], // Substract the server from the user input in case if it entered like 'http://localhost' or 'https://srv.com:100500' or 'localhost:0' - ServerWithoutPrefix = - if Text.StartsWith(Server, "http://") then - Text.RemoveRange(Server, 0, 7) - else if Text.StartsWith(Server, "https://") then - Text.RemoveRange(Server, 0, 8) - else - Server, - ServerWithouPrefixAndPort = - if List.Count(Text.Split(ServerWithoutPrefix, ":")) > 1 then - Text.Split(ServerWithoutPrefix, ":"){0} - else - ServerWithoutPrefix, // And build the proper string on our own - FinalServerString = - if UseSSL then - "https://" & ServerWithouPrefixAndPort & ":" & Text.From(Port) - else - "http://" & ServerWithouPrefixAndPort & ":" & Text.From(Port), + FinalServerString = if UseSSL then + "https://" & Uri.Parts(Server)[Host] & ":" & Text.From(Port) + else + "http://" & Uri.Parts(Server)[Host] & ":" & Text.From(Port), ConnectionString = [ Driver = "OpenSearch SQL ODBC Driver",