@Override
    protected Scope visitDeleteDevice(final DeleteDevice node, final Optional<Scope> context) {
      // Actually write, but will return the result
      queryContext.setQueryType(QueryType.READ);
      node.parseTable(sessionContext);
      accessControl.checkCanDeleteFromTable(
          sessionContext.getUserName(),
          new QualifiedObjectName(node.getDatabase(), node.getTableName()));
      final TsTable table =
          DataNodeTableCache.getInstance().getTable(node.getDatabase(), node.getTableName());
      if (Objects.isNull(table)) {
        TableMetadataImpl.throwTableNotExistsException(node.getDatabase(), node.getTableName());
      }
      DataNodeTreeViewSchemaUtils.checkTableInWrite(node.getDatabase(), table);
      node.parseModEntries(table);
      analyzeTraverseDevice(node, context, node.getWhere().isPresent());
      node.parseRawExpression(
          null,
          table,
          table.getColumnList().stream()
              .filter(
                  columnSchema ->
                      columnSchema.getColumnCategory().equals(TsTableColumnCategory.ATTRIBUTE))
              .map(TsTableColumnSchema::getColumnName)
              .collect(Collectors.toList()),
          queryContext);
      return null;
    }
Visitor context represents local query scope (if exists). The invariant is that the local query
scopes hierarchy should always have outer query scope (if provided) as ancestor.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/analyzer/StatementAnalyzer.java