Skip to content
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

Updated pbi connector #320

Merged
merged 43 commits into from
Dec 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
040552f
Added Tableau Connector to OpenSearch SQL
Nov 17, 2021
c8ddfb9
Merge pull request #1 from Bit-Quill/migrate-jdbc-tableau-connector
Nov 18, 2021
952ff01
Added CEILING and FLOOR functions
Nov 18, 2021
dd357bc
Merge pull request #2 from Bit-Quill/dialect-ceilfloor-AOS220
Nov 18, 2021
580e1af
Added IFNULL function
Nov 18, 2021
a4d2c0c
Added Kyle's fix for ADDDATE and SUBDATE with resulting 00:00:00 bein…
Nov 18, 2021
10aba05
Added MIN and MAX for two string arguments
Nov 18, 2021
5a90ca7
Merge pull request #3 from Bit-Quill/timestamp-issue
Nov 18, 2021
fa32866
Fixed return type for MID function redefenitions, part of AOS-202
Yury-Fridlyand Nov 19, 2021
b852f9d
Added CAST functions to convert to int or string as part of AOS-202
Yury-Fridlyand Nov 19, 2021
65437b2
Added HEXBINX and HEXBINY functions from the templace without any mod…
Yury-Fridlyand Nov 20, 2021
2e50a43
Fixed cast to use the OSSQL type
Yury-Fridlyand Nov 20, 2021
177d132
Added parenthesis to avoid opensearch-project/sql/issues/293
Yury-Fridlyand Nov 20, 2021
2355abf
Merge pull request #6 from Bit-Quill/dialect-strings-AOS-202-CAST
Yury-Fridlyand Nov 20, 2021
0df001a
Pulled from main from OpenSearch
Nov 22, 2021
8596513
Merge branch 'main' of github.com:Bit-Quill/opensearch-project-sql in…
Nov 22, 2021
f212e35
Modified Timestamp conversion formula
Nov 22, 2021
2df3f26
Merge pull request #8 from Bit-Quill/dialect-expr-logical-AOS205
Nov 23, 2021
7aaf59d
Merge pull request #5 from Bit-Quill/dialect-fix-MID-return-type-AOS-202
Yury-Fridlyand Nov 23, 2021
8d8fa1a
Merge pull request #7 from Bit-Quill/dialect-math.hexbin-AOS-195
Yury-Fridlyand Nov 23, 2021
385a41b
Added comment to TimestampType
Nov 23, 2021
26dbb7e
Updated Company Name accroding to the customer's request
Yury-Fridlyand Nov 23, 2021
3a5271e
Merge pull request #9 from Bit-Quill/update-vendor-AOS-231
Yury-Fridlyand Nov 24, 2021
4c63b64
Updated Vendor Name as well
Yury-Fridlyand Nov 24, 2021
edd2159
Merge pull request #10 from Bit-Quill/update-vendor-AOS-231-part-2
Yury-Fridlyand Nov 25, 2021
3f3fa1f
Added few small changes to simplify connector developing and debugging
Yury-Fridlyand Dec 1, 2021
6f046dc
Typo fix
Yury-Fridlyand Dec 1, 2021
f529282
Added a simple test from TDVT: case bool0 from test calcs_data (an ex…
Yury-Fridlyand Dec 1, 2021
b215357
Modified the driver to recognize its support for conversion of types
Dec 4, 2021
b4f3e91
Removed changes from a different branch
Dec 4, 2021
431e01a
Removed changes from a different branch
Dec 4, 2021
e8dafaa
Made the connector convert keyword columns to string columns
Dec 6, 2021
a22afac
Fix requested by PR review
Yury-Fridlyand Dec 7, 2021
47c3445
Merge pull request #11 from Bit-Quill/pbi-connector-dbg-tricks
Yury-Fridlyand Dec 7, 2021
4a97b6c
Modified integration tests to reflect support for conversion types
Dec 7, 2021
f295608
Removed connector changes
Dec 7, 2021
bd49c92
Merge pull request #13 from Bit-Quill/pbi-add-a-tdvt-test-AOS-234
Yury-Fridlyand Dec 8, 2021
284376e
Change values to bitmasks
Dec 8, 2021
8b4e6d2
Merge pull request #14 from Bit-Quill/type-conversion
Dec 8, 2021
3203099
Merge branch 'main' of github.com:opensearch-project/sql into updated…
Dec 9, 2021
2736d1c
Remove changes from irrelevant commits
Dec 9, 2021
858bd64
Remove changes from irrelevant commits
Dec 9, 2021
28abae9
Updated the mez file
Dec 9, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions sql-odbc/src/PowerBIConnector/SqlOdbcPBIConnector.mproj
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@
archiveOut.CreateEntryFromFile(fullPath, filename, CompressionLevel.Optimal);
}
}

File.Copy(OutputFile, Path.Combine(Environment.GetEnvironmentVariable("USERPROFILE"), @"Documents\Power BI Desktop\Custom Connectors", Path.GetFileName(OutputFile)), true);
]]></Code>
</Task>
</UsingTask>
Expand Down
12 changes: 8 additions & 4 deletions sql-odbc/src/PowerBIConnector/SqlOdbcPBIConnector.pq
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ SqlOdbcPBIConnectorImpl = (Server as text) as table =>
SupportsOdbcTimestampLiterals = true
]),

OdbcDatasource = Odbc.DataSource(ConnectionString & CredentialConnectionString & EncryptedConnectionString, [
// Do not view the tables grouped by their schema names.
OdbcOptions = [
// Do not view the tables grouped by their schema names.
HierarchicalNavigation = false,
// Prevents execution of native SQL statements. Extensions should set this to true.
HideNativeQuery = true,
Expand All @@ -129,7 +129,11 @@ SqlOdbcPBIConnectorImpl = (Server as text) as table =>

// Connection string properties used for encrypted connections.
CredentialConnectionString = EncryptedConnectionString
])
],

FullConnectionString = Diagnostics.LogValue("Connection String", ConnectionString & CredentialConnectionString & EncryptedConnectionString),

OdbcDatasource = Odbc.DataSource(FullConnectionString, OdbcOptions)
in
OdbcDatasource;

Expand Down Expand Up @@ -206,7 +210,7 @@ SqlOdbcPBIConnector.Publish = [
LearnMoreUrl = "https://www.opensearch.org/",

// Disabling direct query due to limited SQL query support
SupportsDirectQuery = false,
SupportsDirectQuery = true,

SourceImage = SqlOdbcPBIConnector.Icons,
SourceTypeImage = SqlOdbcPBIConnector.Icons
Expand Down
23 changes: 17 additions & 6 deletions sql-odbc/src/PowerBIConnector/SqlOdbcPBIConnector.query.pq
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,27 @@ section SqlOdbcPBIConnector.UnitTests;
shared MyExtension.UnitTest =
[
// Common variables for all tests
Host = "localhost",
Port = 9200,
Host = "localhost:9200",

facts =
{
Fact("Connection Test",
7,
let
Source = SqlOdbcPBIConnector.Contents(Host,Port),
Source = SqlOdbcPBIConnector.Contents(Host),
no_of_columns = Table.ColumnCount(Source)
in
no_of_columns
),
Fact("calcs_data:bool0",
#table(type table [bool0 = logical],
{ {null}, {false}, {true} }),
let
Source = SqlOdbcPBIConnector.Contents(Host),
calcs_null_null = Source{[Item="calcs",Schema=null,Catalog=null]}[Data],
grouped = Table.Group(calcs_null_null, {"bool0"}, {})
in
grouped
)
},

Expand All @@ -33,11 +42,13 @@ Fact = (_subject as text, _expected, _actual) as record =>
resultOp = if result = "Success ✓" then " = " else " <> ",
addendumEvalAttempt = if attempt[HasError] then @ValueToText(attempt[Error]) else "",
addendumEvalExpected = try @ValueToText(safeExpected) otherwise "...",
addendumEvalActual = try @ValueToText (safeActual) otherwise "...",
addendumEvalActual = try @ValueToText(safeActual) otherwise "...",
ShortenedAddendumEvalExpected = if Text.Length(addendumEvalExpected) > 20 then Text.Range(addendumEvalExpected, 0, 20) & "..." else addendumEvalExpected,
ShortenedAddendumEvalActual = if Text.Length(addendumEvalActual) > 20 then Text.Range(addendumEvalActual, 0, 20) & "..." else addendumEvalActual,
fact =
[ Result = result &" "& addendumEvalAttempt,
[ Result = result & " " & addendumEvalAttempt,
Notes =_subject,
Details = " ("& addendumEvalExpected & resultOp & addendumEvalActual &")"
Details = ShortenedAddendumEvalExpected & resultOp & ShortenedAddendumEvalActual
]
][fact];

Expand Down
Binary file not shown.