我正在尝试查询从 firebase 导出的表,但在从 C# 中访问值时遇到问题。我只需从表中执行 SELECT user_dim.*
即可查询带有前缀 user_dim
的任何内容,但如果我想访问 user_dim.user_properties.value
例如,我无法获取No such field: 'user_properties.value'
。下面的代码正在查询表,它只是没有获取我想要的所有行。
using System;
using Google.Cloud.BigQuery.V2;
namespace BigQueryExample
{
class MainClass
{
public static void Main(string[] args)
{
// Your Google Cloud Platform project ID
string projectId = "hidden";
// Instantiates a client
BigQueryClient client = BigQueryClient.Create(projectId);
var table = client.GetTable("hidden", "hidden", "hidden");
try
{
string query = $@"SELECT user_dim.* FROM `{table.FullyQualifiedId}` LIMIT 100";
var result = client.ExecuteQuery(query);
Console.Write("\nQuery Results:\n------------\n");
foreach (var row in result.GetRows())
{
Console.WriteLine(row["user_properties.value"]);
}
} catch (Exception e)
{
Console.WriteLine(e);
}
Console.ReadLine();
}
}
}
任何关于我如何让它工作的帮助都会很棒。
最佳答案
我只是将查询运行为:
SELECT user_dim.* FROM `table`
这会抓取user_dim
下的所有列
关于c# - Firebase Analytics -> BigQuery 如何在 C# 中查询 user_dim.user_properties,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41487694/