Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 7 additions & 7 deletions MsAdomdClientTester/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,24 @@ class Program
//
// <Properties>
// <PropertyList>
// <Catalog>Adventure Works DW 2008 SE</Catalog>
// <Catalog>MyCatalog</Catalog>
// </PropertyList>
// </Properties>
//
// 4 - restrictions (as xml). can be empty string ("")
//
// <Restrictions>
// <RestrictionList>
// <CUBE_NAME>Adventure Works</CUBE_NAME>
// <CUBE_NAME>MyCube</CUBE_NAME>
// </RestrictionList>
// </Restrictions>
//
// Examples:
// "Data source=http://bi.syncfusion.com/olap/msmdpump.dll" schema MDSCHEMA_CUBES
// "Data source=http://bi.syncfusion.com/olap/msmdpump.dll" schema MDSCHEMA_CUBES "" "<Restrictions><RestrictionList><CUBE_NAME>Adventure Works</CUBE_NAME></RestrictionList></Restrictions>"
// "Data source=http://bi.syncfusion.com/olap/msmdpump.dll" schema MDSCHEMA_CUBES "<Properties><PropertyList><Catalog>Adventure Works DW 2008 SE</Catalog></PropertyList></Properties>" "<Restrictions><RestrictionList><CUBE_NAME>Adventure Works</CUBE_NAME></RestrictionList></Restrictions>"
// "Data source=http://bi.syncfusion.com/olap/msmdpump.dll" query "select from [Adventure Works]"
// "Data source=http://bi.syncfusion.com/olap/msmdpump.dll" query "select from [Adventure Works]" "<Properties><PropertyList><Catalog>Adventure Works DW 2008 SE</Catalog></PropertyList></Properties>"
// "Data source=https://my-server/olap/msmdpump.dll" schema MDSCHEMA_CUBES
// "Data source=https://my-server/olap/msmdpump.dll" schema MDSCHEMA_CUBES "" "<Restrictions><RestrictionList><CUBE_NAME>MyCube</CUBE_NAME></RestrictionList></Restrictions>"
// "Data source=https://my-server/olap/msmdpump.dll" schema MDSCHEMA_CUBES "<Properties><PropertyList><Catalog>MyCatalog</Catalog></PropertyList></Properties>" "<Restrictions><RestrictionList><CUBE_NAME>MyCube</CUBE_NAME></RestrictionList></Restrictions>"
// "Data source=https://my-server/olap/msmdpump.dll" query "select from [MyCube]"
// "Data source=https://my-server/olap/msmdpump.dll" query "select from [MyCube]" "<Properties><PropertyList><Catalog>MyCatalog</Catalog></PropertyList></Properties>"
static void Main(string[] args)
{
if (args.Length > 0)
Expand Down
12 changes: 6 additions & 6 deletions MsAdomdClientTester/README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ dotnet run
See parameters description in Program.cs

Examples:
dotnet run "Data source=http://bi.syncfusion.com/olap/msmdpump.dll;UID=Domain\User;PWD=UserDomainPassword" schema MDSCHEMA_CUBES
dotnet run "Data source=https://my-server/olap/msmdpump.dll;UID=Domain\User;PWD=UserDomainPassword" schema MDSCHEMA_CUBES

dotnet run "Data source=http://bi.syncfusion.com/olap/msmdpump.dll;UID=Domain\User;PWD=UserDomainPassword" schema MDSCHEMA_CUBES "" "<Restrictions><RestrictionList><CUBE_NAME>Adventure Works</CUBE_NAME></RestrictionList></Restrictions>"
dotnet run "Data source=https://my-server/olap/msmdpump.dll;UID=Domain\User;PWD=UserDomainPassword" schema MDSCHEMA_CUBES "" "<Restrictions><RestrictionList><CUBE_NAME>MyCube</CUBE_NAME></RestrictionList></Restrictions>"

dotnet run "Data source=http://bi.syncfusion.com/olap/msmdpump.dll;UID=Domain\User;PWD=UserDomainPassword" schema MDSCHEMA_CUBES "<Properties><PropertyList><Catalog>Adventure Works DW 2008 SE</Catalog></PropertyList></Properties>" "<Restrictions><RestrictionList><CUBE_NAME>Adventure Works</CUBE_NAME></RestrictionList></Restrictions>"
dotnet run "Data source=https://my-server/olap/msmdpump.dll;UID=Domain\User;PWD=UserDomainPassword" schema MDSCHEMA_CUBES "<Properties><PropertyList><Catalog>MyCatalog</Catalog></PropertyList></Properties>" "<Restrictions><RestrictionList><CUBE_NAME>MyCube</CUBE_NAME></RestrictionList></Restrictions>"

dotnet run "Data source=http://bi.syncfusion.com/olap/msmdpump.dll;UID=Domain\User;PWD=UserDomainPassword" query "select from [Adventure Works]"
dotnet run "Data source=https://my-server/olap/msmdpump.dll;UID=Domain\User;PWD=UserDomainPassword" query "select from [MyCube]"

dotnet run "Data source=http://bi.syncfusion.com/olap/msmdpump.dll;UID=Domain\User;PWD=UserDomainPassword" query "select from [Adventure Works]" "<Properties><PropertyList><Catalog>Adventure Works DW 2008 SE</Catalog></PropertyList></Properties>"
dotnet run "Data source=https://my-server/olap/msmdpump.dll;UID=Domain\User;PWD=UserDomainPassword" query "select from [MyCube]" "<Properties><PropertyList><Catalog>MyCatalog</Catalog></PropertyList></Properties>"


-----
Expand All @@ -60,7 +60,7 @@ dotnet add package Microsoft.AnalysisServices.AdomdClient.NetCore.retail.amd64 -

dotnet build MsAdomdClientTester.csproj /property:GenerateFullPaths=true /consoleloggerparameters:NoSummary

dotnet bin/Debug/net6.0/MsAdomdClientTester.dll "Data source=http://bi.syncfusion.com/olap/msmdpump.dll;UID=Domain\User;PWD=UserDomainPassword" schema MDSCHEMA_CUBES
dotnet bin/Debug/net6.0/MsAdomdClientTester.dll "Data source=https://my-server/olap/msmdpump.dll;UID=Domain\User;PWD=UserDomainPassword" schema MDSCHEMA_CUBES

dotnet add package Microsoft.AnalysisServices.AdomdClient.retail.amd64 --version 19.46.0

Expand Down
2 changes: 1 addition & 1 deletion model/csdl/v2/bi/model/bi.ecore
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"
volatile="true" transient="true" derived="true">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="The CSDLBI version the Schema conforms to, as bi:Version. csdlbi.xsd declares no such attribute and a live server sends it on every DISCOVER_CSDL_METADATA response - 2.5 and 2.0 in the two Power BI recordings. Without it the version is read and dropped, and a client cannot tell which revision of the extensions it is looking at."/>
<details key="documentation" value="The CSDLBI version the Schema conforms to, as bi:Version. csdlbi.xsd declares no such attribute and a server sends it on every DISCOVER_CSDL_METADATA response, for example 2.5 or 2.0. Without it the version is read and dropped, and a client cannot tell which revision of the extensions it is looking at."/>
</eAnnotations>
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="attribute"/>
Expand Down
2 changes: 1 addition & 1 deletion model/engine/model/engine.ecore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="engine" nsURI="http://schemas.microsoft.com/analysisservices/2003/engine"
nsPrefix="engine">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="The Analysis Services engine namespace: the object definitions a Create or Alter carries and DISCOVER_XML_METADATA answers with - Server, Database, Cube and the rest. [MS-SSAS] 2.2.4.2: all types in that section are in this namespace unless stated otherwise; the published xmla.xsd re-declares them in the xml-analysis namespace, and the document is the truth. Split out of the former assl package by spec/split_assl_engine_types.py."/>
<details key="documentation" value="The Analysis Services engine namespace: the object definitions a Create or Alter carries and DISCOVER_XML_METADATA answers with - Server, Database, Cube and the rest. [MS-SSAS] 2.2.4.2: all types in that section are in this namespace unless stated otherwise; the published xmla.xsd re-declares them in the xml-analysis namespace, and the document is the truth. Split out of the former assl package."/>
<details key="oSGiCompatible" value="true"/>
<details key="basePackage" value="org.eclipse.daanse.xmla.model"/>
<details key="prefix" value="Engine"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ private static void readRestrictions(XMLStreamReader in, Restrictions into) thro
* <p>
* Both mean the same thing and both become one entry per value, so a caller
* cannot tell which client it is talking to — which is the point. Reading this
* with {@code getElementText()} throws on the second form, so a real Excel
* connect was refused with a parse error before its first
* {@code DISCOVER_PROPERTIES} was answered.
* with {@code getElementText()} throws on the second form, so such a reader
* refuses an Excel connect with a parse error before its first
* {@code DISCOVER_PROPERTIES} gets an answer.
*/
private static void readRestrictionValues(XMLStreamReader in, String name, Restrictions into)
throws XMLStreamException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,7 @@ public static Optional<String> guidOf(EClass eClass) {
* {@code PROPRIETARY} or {@code OBSERVED}.
* <p>
* {@code OBSERVED} is the weakest: no specification describes the rowset, and
* the columns are those a real server answered with. The {@code observedFrom}
* detail beside it names the recorded answer.
* the columns are those Analysis Services answers with.
*/
public static Optional<String> sourceOf(EClass eClass) {
return Optional.ofNullable(detail(eClass, "source"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ class GuidCatalogTest {
private static final Set<String> SHARE_ONE_GUID = Set.of("DMSCHEMA_MINING_MODEL_XML",
"DMSCHEMA_MINING_MODEL_CONTENT_PMML");

/** The statements an {@code evidence} detail may make about a GUID. */
private static final Set<String> EVIDENCE = Set.of(
"Analysis Services lists this GUID in DISCOVER_SCHEMA_ROWSETS, and ADOMD.NET declares the same value.",
"Analysis Services lists this GUID in DISCOVER_SCHEMA_ROWSETS.",
"Analysis Services lists this GUID in DISCOVER_SCHEMA_ROWSETS and refuses the rowset in "
+ "multidimensional mode.",
"ADOMD.NET declares this GUID.");

private static Optional<String> detail(EClass eClass, String key) {
EAnnotation annotation = eClass.getEAnnotation(RowsetCatalog.ANNOTATION);
return annotation == null ? Optional.empty() : Optional.ofNullable(annotation.getDetails().get(key));
Expand Down Expand Up @@ -120,9 +128,9 @@ void noTwoRowsetsShareAGuidExceptTheOnePairThatMust() {
* <p>
* [MS-SSAS] publishes no rowset GUIDs at all — a {@code source=MS-SSAS-*} on a
* rowset says where its <em>columns</em> come from. So any GUID we carry was
* either read off a real server, taken from a decompiled client, or taken from
* OLE DB; and which of the three it was is the only thing that lets a later
* reader weigh it.
* either listed by Analysis Services in {@code DISCOVER_SCHEMA_ROWSETS},
* declared by ADOMD.NET, or taken from OLE DB; and which of the three it was
* is the only thing that lets a later reader weigh it.
*/
@Test
void aGuidNoSpecificationStatesSaysWhereItCameFrom() {
Expand All @@ -141,4 +149,33 @@ void aGuidNoSpecificationStatesSaysWhereItCameFrom() {
assertThat(unattributed).as("these carry a GUID that no specification states and no note attributes, "
+ "so nobody can tell whether it is right").isEmpty();
}

/**
* What is known about a GUID no specification states, in one of a few fixed
* sentences.
* <p>
* The {@code evidence} detail beside {@code guidSource} states what confirms
* the value - Analysis Services listing it, ADOMD.NET declaring it, or both -
* and nothing about how that was found out, so a reader can weigh it from the
* model alone. One statement per rowset: a second one under the same key would
* be hidden behind the first.
*/
@Test
void theEvidenceForAGuidIsOneOfTheFixedStatements() {
List<String> off = new ArrayList<>();
for (Map.Entry<String, EClass> rowset : rowsets().entrySet()) {
EAnnotation annotation = rowset.getValue().getEAnnotation(RowsetCatalog.ANNOTATION);
List<String> evidence = annotation == null ? List.of()
: annotation.getDetails().stream().filter(entry -> "evidence".equals(entry.getKey()))
.map(Map.Entry::getValue).toList();
boolean attributed = detail(rowset.getValue(), "guidSource").isPresent();
boolean fixed = evidence.size() == 1 && EVIDENCE.contains(evidence.get(0));
if (attributed ? !fixed : !evidence.isEmpty()) {
off.add(rowset.getKey() + " " + evidence);
}
}

assertThat(off).as("a GUID with a guidSource carries exactly one evidence detail, worded as one of "
+ "the fixed statements, and a rowset without a guidSource carries none").isEmpty();
}
}
2 changes: 1 addition & 1 deletion model/mddataset/model/mddataset.ecore
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,7 @@
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="RowSetRowItem">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="One column of a tabular Execute result. As with CellProperty the element name is the column name, so it is carried as data. A column may also be structured rather than scalar - SELECT * FROM $SYSTEM.DISCOVER_SCHEMA_ROWSETS returns a Restrictions column holding &amp;lt;Name> and &amp;lt;Type>, repeated once per restriction - so an item may contain further items. All five captured servers do this, on every SSAS version from 11.0 to 16.0."/>
<details key="documentation" value="One column of a tabular Execute result. As with CellProperty the element name is the column name, so it is carried as data. A column may also be structured rather than scalar - SELECT * FROM $SYSTEM.DISCOVER_SCHEMA_ROWSETS returns a Restrictions column holding &amp;lt;Name> and &amp;lt;Type>, repeated once per restriction - so an item may contain further items. Analysis Services does this in every version from 11.0 to 16.0."/>
</eAnnotations>
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="RowSetRowItem"/>
Expand Down
14 changes: 7 additions & 7 deletions model/rowset.core/model/rowset-core.ecore
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<details key="requestType" value="DISCOVER_DATASOURCES"/>
<details key="guid" value="06C03D41-F66D-49F3-B1B8-987F7AF4CF18"/>
<details key="guidSource" value="OBSERVED"/>
<details key="observedFrom" value="Analysis Services, DISCOVER_SCHEMA_ROWSETS answer (recorded-ssas.xml); the same value in ADOMD.NET 19.114.12 AdomdSchemaGuid. [MS-SSAS] states no rowset GUIDs at all, so the source detail above covers the columns, not this."/>
<details key="evidence" value="Analysis Services lists this GUID in DISCOVER_SCHEMA_ROWSETS, and ADOMD.NET declares the same value."/>
<details key="source" value="MS-SSAS-251031"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="dataSourceName" lowerBound="1"
Expand Down Expand Up @@ -151,7 +151,7 @@
<details key="requestType" value="DISCOVER_ENUMERATORS"/>
<details key="guid" value="55A9E78B-ACCB-45B4-95A6-94C5065617A7"/>
<details key="guidSource" value="OBSERVED"/>
<details key="observedFrom" value="Analysis Services, DISCOVER_SCHEMA_ROWSETS answer (recorded-ssas.xml); the same value in ADOMD.NET 19.114.12 AdomdSchemaGuid. [MS-SSAS] states no rowset GUIDs at all, so the source detail above covers the columns, not this."/>
<details key="evidence" value="Analysis Services lists this GUID in DISCOVER_SCHEMA_ROWSETS, and ADOMD.NET declares the same value."/>
<details key="source" value="MS-SSAS-251031"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="enumName" lowerBound="1"
Expand Down Expand Up @@ -230,7 +230,7 @@
<details key="requestType" value="DISCOVER_KEYWORDS"/>
<details key="guid" value="1426C443-4CDD-4A40-8F45-572FAB9BBAA1"/>
<details key="guidSource" value="OBSERVED"/>
<details key="observedFrom" value="Analysis Services, DISCOVER_SCHEMA_ROWSETS answer (recorded-ssas.xml); the same value in ADOMD.NET 19.114.12 AdomdSchemaGuid. [MS-SSAS] states no rowset GUIDs at all, so the source detail above covers the columns, not this."/>
<details key="evidence" value="Analysis Services lists this GUID in DISCOVER_SCHEMA_ROWSETS, and ADOMD.NET declares the same value."/>
<details key="source" value="MS-SSAS-251031"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="keyword" lowerBound="1"
Expand All @@ -257,7 +257,7 @@
<details key="requestType" value="DISCOVER_LITERALS"/>
<details key="guid" value="C3EF5ECB-0A07-4665-A140-B075722DBDC2"/>
<details key="guidSource" value="OBSERVED"/>
<details key="observedFrom" value="Analysis Services, DISCOVER_SCHEMA_ROWSETS answer (recorded-ssas.xml); the same value in ADOMD.NET 19.114.12 AdomdSchemaGuid. [MS-SSAS] states no rowset GUIDs at all, so the source detail above covers the columns, not this."/>
<details key="evidence" value="Analysis Services lists this GUID in DISCOVER_SCHEMA_ROWSETS, and ADOMD.NET declares the same value."/>
<details key="source" value="MS-SSAS-251031"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="literalName" lowerBound="1"
Expand Down Expand Up @@ -336,7 +336,7 @@
<details key="requestType" value="DISCOVER_PROPERTIES"/>
<details key="guid" value="4B40ADFB-8B09-4758-97BB-636E8AE97BCF"/>
<details key="guidSource" value="OBSERVED"/>
<details key="observedFrom" value="Analysis Services, DISCOVER_SCHEMA_ROWSETS answer (recorded-ssas.xml); the same value in ADOMD.NET 19.114.12 AdomdSchemaGuid. [MS-SSAS] states no rowset GUIDs at all, so the source detail above covers the columns, not this."/>
<details key="evidence" value="Analysis Services lists this GUID in DISCOVER_SCHEMA_ROWSETS, and ADOMD.NET declares the same value."/>
<details key="source" value="MS-SSAS-251031"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="propertyName" lowerBound="1"
Expand Down Expand Up @@ -414,7 +414,7 @@
<details key="requestType" value="DISCOVER_SCHEMA_ROWSETS"/>
<details key="guid" value="EEA0302B-7922-4992-8991-0E605D0E5593"/>
<details key="guidSource" value="OBSERVED"/>
<details key="observedFrom" value="Analysis Services, DISCOVER_SCHEMA_ROWSETS answer (recorded-ssas.xml); the same value in ADOMD.NET 19.114.12 AdomdSchemaGuid. [MS-SSAS] states no rowset GUIDs at all, so the source detail above covers the columns, not this."/>
<details key="evidence" value="Analysis Services lists this GUID in DISCOVER_SCHEMA_ROWSETS, and ADOMD.NET declares the same value."/>
<details key="source" value="MS-SSAS-251031"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="schemaName" lowerBound="1"
Expand Down Expand Up @@ -722,7 +722,7 @@
</eClassifiers>
<eClassifiers xsi:type="ecore:EEnum" name="ProviderTypeEnum">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="What kind of data a provider serves, as DISCOVER_DATASOURCES reports it. XMLA 1.1 defines all three and requires a different set of rowsets of each: TDP a tabular data provider, MDP a multidimensional one, DMP a data mining provider implementing OLE DB for Data Mining. A recorded Analysis Services server declares itself all three.&#xA;&#xA;The column is an array, not a single value, which is why one server can be all three at once. The names are the specification's; the numbers are this server's own - see AccessEnum."/>
<details key="documentation" value="What kind of data a provider serves, as DISCOVER_DATASOURCES reports it. XMLA 1.1 defines all three and requires a different set of rowsets of each: TDP a tabular data provider, MDP a multidimensional one, DMP a data mining provider implementing OLE DB for Data Mining. Analysis Services declares itself all three.&#xA;&#xA;The column is an array, not a single value, which is why one server can be all three at once. The names are the specification's; the numbers are this server's own - see AccessEnum."/>
</eAnnotations>
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="ProviderType"/>
Expand Down
Loading
Loading