@Test
    public void testArrayEmbedTo2dMappedTensor_wrongDimensionArgument() {
        var tester = new EmbeddingScriptTester(Map.of("emb1", new EmbeddingScriptTester.MockMappedEmbedder("myDocument.my2DSparseTensor")));

        TensorType tensorType = TensorType.fromSpec("tensor(passage{}, token{})");
        var expression = tester.expressionFrom("input myTextArray | embed emb1 doh | attribute 'my2DSparseTensor'");

        SimpleTestAdapter adapter = new SimpleTestAdapter();
        adapter.createField(new Field("myTextArray", new ArrayDataType(DataType.STRING)));
        adapter.createField(new Field("my2DSparseTensor", new TensorDataType(tensorType)));

        try {
            expression.resolve(new TypeContext(adapter));
            fail("Expected exception");
        } catch (VerificationException e) {
            assertEquals("Invalid expression 'embed emb1 doh': The dimension 'doh' given to embed is not a sparse dimension of the target type tensor(passage{},token{})",
                         e.getMessage());
        }
    }
Multiple paragraphs with sparse encoding (splade style)
indexinglanguage/src/test/java/com/yahoo/vespa/indexinglanguage/EmbeddingScriptTestCase.java