func()

in client/sql/sparksession.go [145:165]


func (s *sparkSessionImpl) analyzePlan(plan *proto.Plan) (*proto.AnalyzePlanResponse, error) {
	request := proto.AnalyzePlanRequest{
		SessionId: s.sessionId,
		Analyze: &proto.AnalyzePlanRequest_Schema_{
			Schema: &proto.AnalyzePlanRequest_Schema{
				Plan: plan,
			},
		},
		UserContext: &proto.UserContext{
			UserId: "na",
		},
	}
	// Append the other items to the request.
	ctx := metadata.NewOutgoingContext(context.Background(), s.metadata)

	response, err := s.client.AnalyzePlan(ctx, &request)
	if err != nil {
		return nil, fmt.Errorf("failed to call AnalyzePlan in session %s: %w", s.sessionId, err)
	}
	return response, nil
}