This commit is contained in:
Ohad Bitton 2020-08-27 16:13:56 +03:00
Родитель 0e1112a98e
Коммит 4a64402e70
3 изменённых файлов: 13 добавлений и 11 удалений

Просмотреть файл

@ -22,7 +22,7 @@ This method is the easiest to follow, just add the following dependency to your
<dependency>
<groupId>com.microsoft.azure.kusto</groupId>
<artifactId>kusto-ingest</artifactId>
<version>2.1.0</version>
<version>2.1.2</version>
</dependency>
```

Просмотреть файл

@ -30,7 +30,7 @@
</developers>
<properties>
<revision>2.1.2</revision> <!-- CHANGE THIS to adjust project version-->
<revision>2.2.0</revision> <!-- CHANGE THIS to adjust project version-->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>

Просмотреть файл

@ -10,20 +10,22 @@ public class Query {
public static void main(String[] args) {
try {
ConnectionStringBuilder csb = ConnectionStringBuilder.createWithAadApplicationCredentials(
System.getProperty("clusterPath"),
System.getProperty("appId"),
System.getProperty("appKey"),
System.getProperty("appTenant"));
ClientImpl client = new ClientImpl(csb);
String ClientID ="d5e0a24c-3a09-40ce-a1d6-dc5ab58dae66";
String pass = "Unh581Hzn50LRWPW5XTMV-3_j5.DdisG3.";
String auth = "microsoft.com";
// IngestClient client = IngestClientFactory.createClient(ConnectionStringBuilder.createWithDeviceCodeCredentials("https://ingest-ohbitton.kusto.windows.net"));
ConnectionStringBuilder csb = ConnectionStringBuilder.createWithAadApplicationCredentials("https://ohbitton.dev.kusto.windows.net/", ClientID, pass, auth);
KustoOperationResult results = client.execute( System.getProperty("dbName"), System.getProperty("query"));
ClientImpl client = new ClientImpl(csb);
ClientRequestProperties clientRequestProperties = new ClientRequestProperties();
clientRequestProperties.setOption("ClientRequestId", "ohadId");
clientRequestProperties.setTimeoutInMilliSec(999999L);
KustoOperationResult results = client.execute( "ohtst", "ddd | take 1",clientRequestProperties);
KustoResultSetTable mainTableResult = results.getPrimaryResults();
System.out.println(String.format("Kusto sent back %s rows.", mainTableResult.count()));
// in case we want to pass client request properties
ClientRequestProperties clientRequestProperties = new ClientRequestProperties();
clientRequestProperties.setTimeoutInMilliSec(TimeUnit.MINUTES.toMillis(1));
results = client.execute( System.getProperty("dbName"), System.getProperty("query"), clientRequestProperties);
} catch (Exception e) {