BigQuery为什么会突然引发数据格式错误

时间:2019-03-18 17:58:46

标签: sql firebase google-bigquery

以下查询突然停止工作:

SELECT
  CAST((SELECT up.value.string_value FROM UNNEST(user_properties) up WHERE key = "user_id") AS INT64) AS user_id,
  (TIMESTAMP_MILLIS(CAST(event_timestamp/1000 AS INT64))) AS event_date
`firebase.dataset.events_*`

错误如下:

bad int64 value:

该查询已经运行了好几个月,今天发生了一些事情导致此错误。有人遇到过同样的问题吗?问题可能出在我们的数据中吗?在GCP方面,这可能是暂时的问题吗?谢谢!

1 个答案:

答案 0 :(得分:1)

使用safe_cast()代替强制转换

void GraphicsScene::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
    auto its =  items(QRectF(event->scenePos() - QPointF(1,1), QSize(3,3)));
    auto val = std::find_if(its.constBegin(), its.constEnd(), [](auto const& it){ // <-- ERROR HERE
        return it->type() > QGraphicsItem::UserType;
    });
    if(val == its.constEnd())
        return;
    if(event->button() == Qt::RightButton){
        showContextMenu(event->scenePos());
    }
    else{
        createDrag(event->scenePos(), event->widget(), *val);
    }
}