Вы должны использовать legacy-SQL. Вместо этого измените ваш запрос на использование стандартного SQL, и тогда все будет хорошо. Например:
WITH
input AS (
SELECT
TIMESTAMP_MILLIS(1547636619070) AS ts)
SELECT
*
FROM
input
WHERE
ts > '2019-01-04'
Каждый раз, когда пользователь проходит панель управления для вычисления Windows Experience Rating, система создает новый файл в %Windows%\Performance\WinSAT\DataStore\
Необходимо найти новый файл (их называют со старшей значащей датой сначала, так находя, что последний файл тривиален).
Эти файлы являются XML-файлами и легки проанализировать с XmlReader или другим xml синтаксическим анализатором.
Раздел, которым Вы интересуетесь, WinSAT\WinSPR
и содержит все очки в единственном разделе. Например.
<WinSAT>
<WinSPR>
<SystemScore>3.7</SystemScore>
<MemoryScore>5.9</MemoryScore>
<CpuScore>5.2</CpuScore>
<CPUSubAggScore>5.1</CPUSubAggScore>
<VideoEncodeScore>5.3</VideoEncodeScore>
<GraphicsScore>3.9</GraphicsScore>
<GamingScore>3.7</GamingScore>
<DiskScore>5.2</DiskScore>
</WinSPR>
...
Вот отрывок для VB.NET. Преобразованный в C# (использующий это, я еще на самом деле не протестировал код, хотя он надеется быть прекрасным).
/// <summary>
/// Gets the base score of a computer running Windows Vista or higher.
/// </summary>
/// <returns>The String Representation of Score, or False.</returns>
/// <remarks></remarks>
public string GetBaseScore()
{
// Check if the computer has a \WinSAT dir.
if (System.IO.Directory.Exists("C:\\Windows\\Performance\\WinSAT\\DataStore"))
{
// Our method to get the most recently updated score.
// Because the program makes a new XML file on every update of the score,
// we need to calculate the most recent, just incase the owner has upgraded.
System.IO.DirectoryInfo Dir = new System.IO.DirectoryInfo("C:\\Windows\\Performance\\WinSAT\\DataStore");
System.IO.FileInfo[] fileDir = null;
System.IO.FileInfo fileMostRecent = default(IO.FileInfo);
System.DateTime LastAccessTime = default(System.DateTime);
string LastAccessPath = string.Empty;
fileDir = Dir.GetFiles;
// Loop through the files in the \WinSAT dir to find the newest one.
foreach (var fileMostRecent in fileDir)
{
if (fileMostRecent.LastAccessTime >= LastAccessTime)
{
LastAccessTime = fileMostRecent.LastAccessTime;
LastAccessPath = fileMostRecent.FullName;
}
}
// Create an XmlTextReader instance.
System.Xml.XmlTextReader xmlReadScore = new System.Xml.XmlTextReader(LastAccessPath);
// Disable whitespace handling so we don't read over them
xmlReadScore.WhitespaceHandling = System.Xml.WhitespaceHandling.None;
// We need to get to the 25th tag, "WinSPR".
for (int i = 0; i <= 26; i++)
{
xmlReadScore.Read();
}
// Create a string variable, so we can clean up without any mishaps.
string SystemScore = xmlReadScore.ReadElementString("SystemScore");
// Clean up.
xmlReadScore.Close();
return SystemScore;
}
// Unsuccessful.
return false;
}
Я предполагаю, что это только возвращает суммарный рейтинг, но надо надеяться это должно запустить Вас, по крайней мере. Это может только быть вопрос изменения имени файла/параметра для получения отдельных оценок.